【问题标题】:sphinx select returning empty results but hits do exist狮身人面像选择返回空结果,但命中确实存在
【发布时间】:2014-04-18 08:17:48
【问题描述】:

更新:它现在正在工作。

解决方案:我关闭了 sphinxsearch 服务,删除了我的索引文件,重建了索引,启动了服务,现在我得到了结果。

我一直在试图弄清楚为什么我无法从 Sphinx 搜索和获取结果。

我已经完成了一个索引(成功)

total 16261878 docs, 26084076839 bytes
total 3661.072 sec, 7124709 bytes/sec, 4441.83 docs/sec
total 131 reads, 53.673 sec, 106140.4 kb/call avg, 409.7 msec/call avg
total 25714 writes, 43.170 sec, 1231.8 kb/call avg, 1.6 msec/call avg

但是当我尝试执行搜索时select * from skoovy_prd_post search where match('five guys') limit 10

mysql -P 9306 -h127.0.0.1
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7

MySQL [(none)]> select * from skoovy_prd_post_search where match('five guys') limit 10;

我收到:

Empty set (0.00 sec)

但是对“五个人”执行一个命中列表,我肯定有结果:

indextool --dumphitlist skoovy_prd_post_search 'five guys' |more
Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
dumping hitlist for index 'skoovy_prd_post_search' keyword 'five guys'...
keyword=five guys, tok=five, wordid=1018350795
doc=3327, hit=0x01000001
doc=3327, hit=0x03000004
doc=3327, hit=0x23000006
doc=3327, hit=0x23000011
doc=3327, hit=0x24000006
doc=3327, hit=0x24000010
doc=3327, hit=0x25000006
doc=3327, hit=0x25000011
doc=3327, hit=0x26000006
doc=3327, hit=0x26000010
doc=43112, hit=0x01000001
doc=43112, hit=0x03000004
doc=43112, hit=0x23000006
doc=43112, hit=0x23000011

有人有什么想法、建议或知道这是为什么吗?

【问题讨论】:

    标签: mysql sql sphinx mariadb


    【解决方案1】:

    indextool --dumphitlist 仅转储一个关键字的命中,即第一个关键字,即使您传递了多个关键字。请注意,默认情况下,搜索是合取的(隐式 AND)。

    【讨论】:

    • 但我确实有包含“五个人”的记录。事实上,第一组记录是“五个人”的记录。仅在列表的下方(列表比我发布的要大得多)是匹配“五个”或“家伙”的记录
    • 我想通了。不是为什么会发生,而是如何让它发挥作用。
    • 我看不出您可能遇到了什么问题,除非您的 min_word_len > 4 或者您将该列声明为字符串属性。
    【解决方案2】:

    我关闭了 sphinxsearch 服务,删除了我的索引文件,重建了索引,启动了服务,现在我得到了结果。

    我确实看到其他人在他们遇到的各种其他问题上也这样做了,所以我想将其添加到列表中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多