全文口音

时间:2015-10-01 09:47:41

标签: sql sql-server full-text-search diacritics

如何让我这两个查询返回相同的结果?

móvilmovil

表格行
INSERT [Palabras]([Id],[texto])VALUES(1,N'Movil iphone 6')
INSERT [Palabras]([Id],[texto])VALUES(2,N'Móviliphone6')
INSERT [Palabras]([Id],[texto])VALUES(3,N'Moviles iphone 6')
INSERT [Palabras]([Id],[texto])VALUES(4,N'Móvilesiphone6')

返回4行:

SELECT *
FROM Palabras
WHERE CONTAINS(*, N'FORMSOF(INFLECTIONAL, "móvil", 3082, NULL, 0)');

返回2行:
只返回: Movil iphone 6 Móviliphone6

SELECT *
FROM Palabras
WHERE CONTAINS(*, N'FORMSOF(INFLECTIONAL, "movil", 3082, NULL, 0)')



查看分词系统,同义词库和停止列表组合的标记化结果:

SELECT *
FROM sys.dm_fts_parser(N'FORMSOF(INFLECTIONAL, "móvil")', 3082, NULL, 0);

Display_term:movilesmovil

SELECT *
FROM sys.dm_fts_parser(N'FORMSOF(INFLECTIONAL, "movil")', 3082, NULL, 0);

Display_term:movil

1 个答案:

答案 0 :(得分:1)

将全文目录ACCENT_SENSITIVITY更改为关闭并重建。

ALTER FULLTEXT CATALOG [MyFullTextCatalog] REBUILD WITH ACCENT_SENSITIVITY = OFF