假设您有以下查询(使用 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 à')
我错过了什么?
谢谢!