Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Full text search - Not stopping StopWords

I created a full text index using the SQL Server Full Text wizard but when I pass in a search term it doesn't ignore stopwords.

i.e. This returns rows:

SELECT *
FROM dbo.T_Restaurant AS Restaurant
JOIN dbo.SearchView AS SearchView ON SearchView.id = Restaurant.id
WHERE CONTAINS(SearchView.TotalSearchField, ' indian & bridgwater ')

But this doesn't:

SELECT *
FROM dbo.T_Restaurant AS Restaurant
JOIN dbo.SearchView AS SearchView ON SearchView.id = Restaurant.id
WHERE CONTAINS(SearchView.TotalSearchField, ' indian & in & bridgwater ')

I know that 'in' is a stopword in the English language and yet it doesn't appear to be ignored. The index is using the System stopword list according to its properties. Have I missed a step to set the stopword list up?

Many thanks,

Chris.

like image 822
Chris Chambers Avatar asked Dec 04 '25 00:12

Chris Chambers


1 Answers

Does this FTS syntax work better? I think it will have taken indian & bridgewater to be a phrase rather than looking for the words which is what I think you are trying to do.

SELECT *
FROM dbo.T_Restaurant AS Restaurant
JOIN dbo.SearchView AS SearchView ON SearchView.id = Restaurant.id
WHERE CONTAINS(SearchView.TotalSearchField, '"indian" AND "bridgwater"')

SELECT *
FROM dbo.T_Restaurant AS Restaurant
JOIN dbo.SearchView AS SearchView ON SearchView.id = Restaurant.id
WHERE CONTAINS(SearchView.TotalSearchField, '"indian" AND "IN" AND "bridgwater"')
like image 112
u07ch Avatar answered Dec 06 '25 15:12

u07ch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!