|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have built a directory that allows users to search via business names.
The data is stored in MS Sql database. The website has been been developed using asp scripting. My problem comes down to this. If a user searches for joe smith refridgeration they can do so by entering joe, smith, joe smith, refridgeration, joe smith refridgeration, smith refridgeration but i need to make it work if some enters refridgeration joe smith, joe refridgeration etc. Is this possibe? Does anyone know how to do it? Thanks in advance. |
|
#2
|
|||
|
|||
|
Have you ASP code generate a query that has a LIKE statement for every search term like the example below.
SELECT * FROM datatable WHERE textdata LIKE '%refridgeration%' AND textdata LIKE '%joe%' AND textdata LIKE %'smith%' |
|
#3
|
|||
|
|||
|
Currently the user is inserting all that data into the one field.
So how would I go about splitting the field down into seperate query string elements? |
|
#4
|
|||
|
|||
|
Not sure how to do it in ASP, but it can't be that difficult. I think you wout use the cut function.
|
|
#5
|
|||
|
|||
|
i use frontpage to modify asp pages and i have a database results proporties options and it lets me split a text field up separated by commas or whatever and you can do your query with like or contains based on a specific field.
|
|
#6
|
||||
|
||||
|
The best option is Full Text, read:
http://www.sqlmag.com/Articles/Index.cfm?ArticleID=8967 and http://www.microsoft.com/sql/evalua...es/fulltext.asp Nice tutorial: http://www.15seconds.com/issue/010423.htm
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) Understanding SQL Joins An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > text searching |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|