【问题标题】:Sphinx search exact match狮身人面像搜索完全匹配
【发布时间】:2016-07-07 15:04:11
【问题描述】:

在我的 SphinxSearch 索引中,我希望在搜索阶段的第一个位置完全匹配。但我在第 6 位得到了精确的数学计算。

例如:

SELECT id, WEIGHT()
FROM `products_elit_cs`
WHERE MATCH('BKR5EK') 
ORDER BY WEIGHT() DESC
OPTION ranker=sph04

返回 [sphinxsearch 结果]

id  weight()
199001  7528
279018  7528
385989  7528
4513542 7528
4759603 7528
58449   7527
297335  6528
4759601 6527
5030474 6527
341879  4527

但源数据是[mysql结果]

id  active_number_cs
58449   BKR5EK
199001  BKR5EKU
279018  BKR5EKUP
297335  BKR5EKB-11
341879  V-23 BKR5EK
385989  BKR5EKC
4513542 BKR5EKUD
4759601 BKR5EKPB-13
4759603 BKR5EKUC
5030474 BKR5EKPB-11

注意,id 为 58449 的记录是精确的数学运算。

我们使用 2.1.6 版的 sphinxsearch。

【问题讨论】:

    标签: full-text-search sphinx


    【解决方案1】:

    我猜你有enable_star=0 是吗? http://sphinxsearch.com/docs/archives/manual-2.1.6.html#conf-enable-star

    建议改成enable_star=1,然后加expand_keyword=1 http://sphinxsearch.com/docs/archives/manual-2.1.6.html#conf-expand-keywords

    这应该允许您将完全匹配的排名更高。可能需要尝试不同的排名表达式。 http://sphinxsearch.com/docs/archives/manual-2.1.6.html#weighting

    【讨论】:

      猜你喜欢
      • 2011-07-13
      • 1970-01-01
      • 2015-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多