ContainsTable:噪音/停止词没有结果

时间:2018-02-20 17:01:07

标签: sql-server full-text-search containstable noise-words

假设您有以下查询(使用PT语言):

declare @textoPesquisa as nvarchar(200) = 'haiti and florida and à'
if(@textoPesquisa is null or @textoPesquisa='') set @textoPesquisa = '*'

select * from Noticias n    
 left join containstable(NoticiasParaEstatistica, (Titulo), @textoPesquisa, 
                          LANGUAGE N'Portuguese')  s on n.IdNoticia=s.[key]
 where s.[key] is not null

 select * from NoticiasParaEstatistica where contains(titulo, 
       @textoPesquisa,LANGUAGE N'Portuguese')

我认为à被视为停用词,因此之前的查询没有返回任何结果(因为我使用的是AND)。现在,如果我关闭禁用词列表,一切正常,但这看起来不是一个好选择。

在查看文档后,我找到了transform noise words option。我已经在服务器中激活了它并且我重建了目录,但我仍然得到0结果。

顺便说一句,这里的表+插入可能能够重现这种情况:

CREATE TABLE [dbo].[NoticiasParaEstatistica](
   [IdNoticia] [bigint] NOT NULL,
   [Titulo] [varchar](400) NOT NULL
 CONSTRAINT [PK_NoticiasParaEstatistica] PRIMARY KEY CLUSTERED 
(
   [IdNoticia] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, 
 ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


INSERT INTO NoticiasParaEstatistica (Titulo)
values ('haiti florida à')

我错过了什么?

谢谢!

0 个答案:

没有答案