【问题标题】:Fulltext stopllist failing on removed stop word删除停用词时全文停用词列表失败
【发布时间】:2019-02-19 23:06:09
【问题描述】:

我希望能够对单词“no”进行全文搜索,但不断收到错误消息。步骤如下:

我根据系统停止列表创建了一个新的停止列表,然后从停止列表中删除了单词“no”。

CREATE FULLTEXT STOPLIST ADSStopList FROM SYSTEM STOPLIST;
ALTER FULLTEXT STOPLIST ADSStopList DROP 'no' LANGUAGE 'English';

我可以看到“否”已从停止列表中删除:

select w.* 
from sys.fulltext_stoplists l
inner join sys.fulltext_stopwords w on l.stoplist_id = w.stoplist_id
where language = 'English' 
    and l.name = 'ADSStopList' 
    and stopword like '%no%';

停用词结果为anothernowno 已被删除。

我使用no 停用词运行测试:

Select * from sys.dm_fts_parser('no part', 1033, 5, 0)

我得到错误:

Msg 7630, Level 15, State 3, Line 99
Syntax error near 'PART' in the full-text search condition 'NO PART'.

如果我从sys.dm_fts_parser 函数中删除单词“no”,它会成功。我做错了什么?

【问题讨论】:

    标签: sql-server full-text-search


    【解决方案1】:

    想通了。我必须将搜索字符串放在双引号中。

    Select * from sys.dm_fts_parser('"no part"', 1033, 5, 0);
    

    【讨论】:

      猜你喜欢
      • 2021-02-02
      • 2018-09-28
      • 1970-01-01
      • 2018-04-19
      • 2017-06-21
      • 2010-11-11
      • 2016-05-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多