Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Search Engine Needed 2

Status
Not open for further replies.

ChrisBelzona

Programmer
Oct 25, 2000
137
GB
Hi

Hope you can help?

I'm wondering if anyone has written or found Search Engine Coding for ASP pages. I'm trying to replicate a web search engine for a online database, the results will be a link to a page displaying the selected record. The search will be on multi fields.

I have seen plenty of basic code that search multi fields but they are limilted on the search criteria, I'm looking to search for example 'ASP and Microsoft' so it pick up on either word, I would also like it to provide a rating.

I know there is an article by David McAlister on this subject but its in a subscribe site (and I'm not sure if it's what I need).

Any Help Would be fantastic even I have purchased an app to do the search.

Cheers

Chris
 
I implemented a boolean search like the one you're looking for in a project I have at home. If you want a home grown solution, you'll need to get comfortable with using regular expressions to parse the search string, or by using the InStr function religiously to break up the query - this depends on how you want to implement the search.

after you break up the string, you need to figure out what columns you want to search on, and create your SQL query that way. Let me show you an example.

qry:
ASP and Microsoft

resulting SQL:
SELECT * FROM tbl WHERE (col1 LIKE '%ASP%' AND col1 LIKE '%Microsoft%') OR (col2 LIKE '%ASP%' AND col2 LIKE '%Microsoft%')

This type of search has it's limitations, though, because searching '%ASP%' will pull up all the records with ASP in it. So 'clASPs' would be a matching record, again - if you think that this is ok, then it wouldn't be too much of a problem.

If you are using SQL Server, it comes with something called full-text indexing, which saved my butt while developing the search engine for work. It doesn't come installed by default.

Hope this helps you out. If you have any more questions feel free to post them.
leo
 
I'm just trying to make a simple search ASP page to search my SQL 2000 database. I need help figuring out the syntax for the ASP page that get's the user's keyword into a query. Thanks.
 
Vasah20, did you finished developing the search engine for ASP? just curious. I think I will need something like that soon and already started researching.

Any suggestions? I am trying to go beyond the %like% sentence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top