Complete word queries?

Complete word queries?

Post by Dan Mart » Wed, 16 Jul 2003 12:20:35



I am trying to create a query that searches for key words in text fields for
a web based helpdesk application.  Currently I am using the like operator
but if I do a search on problems with ACT (a contact management app) if will
find all cases with those letters in the history.  Example below:

Select * from cases where case_history like '%ACT%'

Finds the word ACT but also contact, actor, contractor, and so on.  I do
need it to find words like updates if the user types update or printing if
the user types printer.  Also the above query only finds words that are
grouped together, so if the user types ACT printing problem, if will only
find cases that have that exact phrase instead of just the three keywords.

Any help would be greatly appriciated
Dan

 
 
 

Complete word queries?

Post by Jacco Schalkwij » Wed, 16 Jul 2003 12:31:05


I think you should have a look at Full-text search. BOL has a lot of content
about it and there is also a newsgroup about it
(microsoft.public.sqlserver.fulltext). It is a lot more powerful then LIKE,
and can do things like looking for 3 keywords at once.

--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.


Quote:> I am trying to create a query that searches for key words in text fields
for
> a web based helpdesk application.  Currently I am using the like operator
> but if I do a search on problems with ACT (a contact management app) if
will
> find all cases with those letters in the history.  Example below:

> Select * from cases where case_history like '%ACT%'

> Finds the word ACT but also contact, actor, contractor, and so on.  I do
> need it to find words like updates if the user types update or printing if
> the user types printer.  Also the above query only finds words that are
> grouped together, so if the user types ACT printing problem, if will only
> find cases that have that exact phrase instead of just the three keywords.

> Any help would be greatly appriciated
> Dan


 
 
 

Complete word queries?

Post by SriSam » Wed, 16 Jul 2003 12:33:48


Looks like you need to go the Full-Text indexing route to do efficient word
searches in character string data. Check out the SQL Server BOL on how to
setup full-text indexing.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp


Quote:> I am trying to create a query that searches for key words in text fields
for
> a web based helpdesk application.  Currently I am using the like operator
> but if I do a search on problems with ACT (a contact management app) if
will
> find all cases with those letters in the history.  Example below:

> Select * from cases where case_history like '%ACT%'

> Finds the word ACT but also contact, actor, contractor, and so on.  I do
> need it to find words like updates if the user types update or printing if
> the user types printer.  Also the above query only finds words that are
> grouped together, so if the user types ACT printing problem, if will only
> find cases that have that exact phrase instead of just the three keywords.

> Any help would be greatly appriciated
> Dan

 
 
 

1. Query for words similar to other words

I am working with SQL Server 2000. My scenario is as follows: I have a
Customer table, containing standard info such as first and last name, email,
etc. I need to create a query that will return all the names similar to the
search string, such as:

SELECT * FROM Customer WHERE First_Name (is kinda like) 'John'

Would return names such as John, Jon, Jonathan, etc.

What is my best bet for a fuzzy search like this?

Thanks,

Devin Carlen

2. 11273-TN-Nashville-Visual Basic-ORACLE-GUI-MS ACCESS-Programmer/Analyst

3. Query analyser shows print statments only after loop query completes

4. Cannot install VFoxPro5 ODBC Driver

5. Not enough memory to complete query

6. How to transpose multiple fields into one filed?

7. Need Complete SQL Queries for the reference

8. SQL Server is enable to complete a query...

9. Query with Multiple Joins takes forever to complete

10. Esimating Time to Complete a Query

11. Queries for complete DB schema?

12. This query takes more than 2 minutes to complete