2012年3月21日星期三

Full Text Search - Conatins doesnot work

Our SQL Server 2000 (sp1) on a Windows 2000 system is configured for a full text search.

The ntext column having a full text index has a value as follows:

Rob Proctor's Tips: Creating a "Tropical" Get-Away At Home

when I search it by

SELECT NTEXT_COL
FROM FULL_TEXT_TABLE
WHERE CONTAINS(NTEXT_COL, N'"Tropical Get Away"')

it displays the result as

NTEXT_COL
======================================
Rob Proctor's Tips: Creating a "Tropical" Get-Away At Home

But the query

SELECT NTEXT_COL
FROM FULL_TEXT_TABLE
WHERE CONTAINS(NTEXT_COL, N'"Tropical Get Aw*"')

do not return any rows..

Can anybody give me the reason for this behaviour, or is it a known bug?

Thanks

Sajan'Get' is included in Noise-word file and therefore query does not return what do you expect. Just remove hyphen from Get-Away (GetAway), repopulate index, run query and you'll see.

SELECT NTEXT_COL
FROM FULL_TEXT_TABLE
WHERE CONTAINS(NTEXT_COL, N'"Tropical GetAw*"')

I agree it is stupid but I guess it was designed this way. You could update list of your Noise words but size of indexes will be increased...

没有评论:

发表评论