简体   繁体   English

全文搜索Sql Server 2008问题

[英]Full text search Sql Server 2008 question

Let's say I have the following string stored in a column which has full-text: 假设我将以下字符串存储在具有全文的列中:

xx 3 555 7 4 xx 3 555 7 4

My question is why a search using FREETEXT for the word '555' would not return anything 我的问题是,为什么将FREETEXT用作单词“ 555”的搜索不会返回任何内容

You can't use full text search on numbers :( You can try using LIKE, although performance may be an issue. Another thing that you can try is encapsulating the search term in double-quotes, although I don't think that will help you here. 您不能对数字使用全文搜索:(您可以尝试使用LIKE,尽管性能可能会成为问题。您可以尝试的另一种方法是将搜索词用双引号引起来,尽管我认为这不会有所帮助你在这里。

One other thing that you can try... add "NN" to the start of your search term. 您可以尝试的另一件事...在搜索词的开头添加“ NN”。 So, instead of searching for '555', try searching for 'NN555'. 因此,尝试搜索“ NN555”而不是搜索“ 555”。 Supposedly MS does store the numeric words in the index, but it appends "NN". 假设MS确实将数字单词存储在索引中,但是它附加了“ NN”。 That was back in SQL 2005. I don't know if it still holds true in 2008. 那是在SQL 2005中。我不知道它是否在2008年仍然适用。

Try creating the fulltext index using the LANGUAGE [NEUTRAL] option. 尝试使用LANGUAGE [NEUTRAL]选项创建全文索引。

http://msdn.microsoft.com/en-us/library/ms187317.aspx http://msdn.microsoft.com/en-us/library/ms187317.aspx

Create Fulltext Index On YourTable (YourColumn Language [Neutral])
Key Index YourKey;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM