Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Quickest way to search in ASPX


Message #1 by info@e... on Fri, 26 Apr 2002 17:37:36
Hello All,

I am  trying to figure out was is the quickest way to perform a keyword 
search in aspx. Particularly to search a keyword in multiple fields of a 
100,000 + records SQL Server database. With classic asp, I simply had a 
SQL stored procedure that would read something like: 

"SELECT * FROM TABLE WHERE field1 LIKE '%' + @keyword + '%' OR field2 
LIKE '%' + @keyword + '%' OR field3 LIKE '%' + @keyword + '%' OR field4 
LIKE '%' + @keyword + '%' OR field5 LIKE '%' + @keyword + '%'".

This would work fine but it takes along time to search. It is scanning 
each field in every record first, and then moves to the other fields. I do 
have an index in the database for faster access but I know there must be a 
better way to make this happen. I would appreciate any examples in C#. 
Thanks in advance!

I would also like to know how to split the keyword the user types and 
apply it to the search. In the query I have above, it would only find the 
records if two words are together. If you would search for "asp.net 
components", it would only find the records that have "asp.net 
components", the two words together. It would not find a record if it 
contained "asp.net and c# components" even tough both of the keywords are 
in there. Thanks again!

- Elmer M.
Message #2 by Feduke Cntr Charles R <FedukeCR@m...> on Mon, 29 Apr 2002 09:09:55 -0400
	I haven't actually had a need for this yet, but have you tried SQL
Server's Full Text Searching?  I think its supposed to be on par with
Oracle's full text search and allow you to do things similiar to what you
are doing without having to write alot of SQL.

	Let me know if you use SQL Server Full Text Searching and/or if it
works.

- Chuck

-----Original Message-----
From: info@e... [mailto:info@e...]
Sent: Friday, April 26, 2002 1:38 PM
To: ASP+
Subject: [aspx] Quickest way to search in ASPX


Hello All,

I am  trying to figure out was is the quickest way to perform a keyword 
search in aspx. Particularly to search a keyword in multiple fields of a 
100,000 + records SQL Server database. With classic asp, I simply had a 
SQL stored procedure that would read something like: 

"SELECT * FROM TABLE WHERE field1 LIKE '%' + @keyword + '%' OR field2 
LIKE '%' + @keyword + '%' OR field3 LIKE '%' + @keyword + '%' OR field4 
LIKE '%' + @keyword + '%' OR field5 LIKE '%' + @keyword + '%'".

This would work fine but it takes along time to search. It is scanning 
each field in every record first, and then moves to the other fields. I do 
have an index in the database for faster access but I know there must be a 
better way to make this happen. I would appreciate any examples in C#. 
Thanks in advance!

I would also like to know how to split the keyword the user types and 
apply it to the search. In the query I have above, it would only find the 
records if two words are together. If you would search for "asp.net 
components", it would only find the records that have "asp.net 
components", the two words together. It would not find a record if it 
contained "asp.net and c# components" even tough both of the keywords are 
in there. Thanks again!

- Elmer M.

  Return to Index