使用 SphinxQL 仅查找精确的词机
Find only exact word maches using SphinxQL
我正在尝试使用 Sphinx 查找在 title
列中具有 words
的行。
查询如下所示:
SELECT * FROM my_table WHERE MATCH ('@title "words"')
但它也 returns 行在标题中有 word
(没有 s
)而不是 words
。
我做错了什么?
听起来您在索引上启用了 morphology
(特别是词干提取?)。
应该考虑启用index_exact_words
http://sphinxsearch.com/docs/current.html#conf-index-exact-words
它为您提供精确的形式运算符。
MATCH('@title =words')
还为您提供了有趣的 expand_keywords
选项的可能性 :)
http://sphinxsearch.com/docs/current.html#conf-expand-keywords
... 或者如果 曾经 不想要这些匹配项,可以禁用词干提取 :) 可惜没有 'stemming optional' 模式。 (例如 ~ 模糊运算符专门用于词干)
我正在尝试使用 Sphinx 查找在 title
列中具有 words
的行。
查询如下所示:
SELECT * FROM my_table WHERE MATCH ('@title "words"')
但它也 returns 行在标题中有 word
(没有 s
)而不是 words
。
我做错了什么?
听起来您在索引上启用了 morphology
(特别是词干提取?)。
应该考虑启用index_exact_words
http://sphinxsearch.com/docs/current.html#conf-index-exact-words
它为您提供精确的形式运算符。
MATCH('@title =words')
还为您提供了有趣的 expand_keywords
选项的可能性 :)
http://sphinxsearch.com/docs/current.html#conf-expand-keywords
... 或者如果 曾经 不想要这些匹配项,可以禁用词干提取 :) 可惜没有 'stemming optional' 模式。 (例如 ~ 模糊运算符专门用于词干)