SQL Server 2008全文本搜索 [英] Sql Server 2008 Full text Search
问题描述
我在我的网站中使用全文搜索功能.我有带有"AT& T"标题的唱片.
当我执行"AT& T"搜索时,并没有得到"AT& T"的提示.我还检查了"L-3",它也
找不到,但是当我执行没有全文搜索的子字符串搜索时,那应该显示所需的结果.
甚至我都不愿意采石从sys.dm_fts_index_keywords(db_id(``IWPC''),object_id(``ARC_DOCUMENT''))中选择*,其中display_term如%at& t%""
也不会显示"AT& T"的结果.
我的问题是如何将"AT& T"索引为单个单词,以及如何获得针对"AT& T"的搜索结果
I am using Full text search feature in my website. I have Record with "AT&T" Title.
When i am preforming search for "AT&T" that doesn''t gives me the of "AT&T". I have also check for "L-3" that also
not found but when i perform sub string search without Fulltext search then that should display desired results.
Even I tired to quarry "select * from sys.dm_fts_index_keywords(db_id(''IWPC''), object_id(''ARC_DOCUMENT'')) Where display_term like''%at&t%''"
that also doesn''t display result for "AT&T".
My Question is how can i index "AT&T" as single word and how can i get search result against "AT&T"
推荐答案
/* try to find out in this way */
/* CandidateDetails.LastName like ''%" + SearchByName + "%'' "; there should not be any space between ''%YourWord %'' because it considered space also */
/* i have tried this and working Properly May be There is some Other Error */
insert into test1 values(''AT&T'')
select Name from test1 where Name like''%AT&T%''
select Name from test1 where Name like ''%at&t%''
Name
---------------------------
AT&T
(1 row(s) affected)
Name
---------------------------
AT&T
(1 row(s) affected)
这篇关于SQL Server 2008全文本搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!