开发者

Sql Server 2008 not ignoring a noise word in a fulltext phrasal query?

开发者 https://www.devze.com 2023-03-23 12:28 出处:网络
Lets assume we have a table with a fulltext field on it. This field is called text. The content of the table would be:

Lets assume we have a table with a fulltext field on it. This field is called text. The content of the table would be:

car wash
car and wash

The word and is in my stoplist

Now, I will query this table using this sql:

select * from mytable
开发者_开发知识库where contains(text, '"car wash"')

This query only returns the car wash row and not the car and wash row. By assuming that the word and is a stop word, why is not Sql returning the car and wash row?

I know I am doing a phrasal search (using ""). That is exactly what I need, but I think that Sql should ignore words in the stop list and that is not what is happening. It is driving me crazy.

My understand is that when FT algorithm finds a phrase like car and wash it will index only car and wash. Is this true?

Also when I query the ft_parser it says what I expected it to say:

SELECT * FROM sys.dm_fts_parser ('"car and wash"', 1033, 5, 0)

    special_term    display_term    
    Exact Match         car 
    Noise Word          and 
    Exact Match         wash    

Any thoughts?


Look at this article: stopwords

Although fts ignores the inclusion of stopwords, the full-text index does take into account their position

after fts ignores "and" word, "car" and "wash" positions will be 1 and 3. So it can't be found.

I suggest another term instead. Maybe you would like to use something like 'car AND wash', or other term. That depends on business logic

0

精彩评论

暂无评论...
验证码 换一张
取 消