Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Full text catalog : Search problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-04-12 : 08:34:53
NetWeb Software writes "Hello All,

We are using SQL Server 2000 as our database. We have implemented full text catalog for the free text searching utility in our application. While testing the implementation of the mentioned catalog based search, we found that the search mechanism igoners '_' (underscore) when specified as the first character of search text. For example, search result for "_option" returns result for "option" and "_" is ignored when there is a valid content that has occurences of "_option" or "_new".

We had removed "_" from the noise word files (noise.enu and noise.eng)of SQL server while implementing the changes. Also, we believe that SQL server catalog based search does not consider "_" as either a Punctuation symbol or a Word breaker.

We are not able to figure out why is the search result for "_option" is returning result for only "option" and ignoring the content "_option". We would appreciate a help on this matter.

For more details on this matter, When we run any one of the following query, we get the same results.

Query-1:
----------
SELECT *
FROM searchtable
WHERE CONTAINS(freetext, '"_option*"')

Query-2:
----------
SELECT *
FROM searchtable
WHERE CONTAINS(freetext, '"option*"')"

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2005-04-12 : 10:00:15
I dont see how either of those queries runs. The syntax looks totally wrong. From BOL:
USE Northwind
GO
SELECT CategoryName
FROM Categories
WHERE FREETEXT (Description, 'sweetest candy bread and dry meat' )

So your query should look something like this using FREETEXT:

SELECT * FROM <table>
WHERE FREETEXT(<column>,'_option')

or like so using CONTAINS:

SELECT * FROM <table>
WHERE CONTAINS(<column>,' "_option*" ')

Go to Top of Page
   

- Advertisement -