我有一张简单的桌子
id: primary
name: varchar fulltext index这是我的Sphinx https://justpaste.it/1okop
索引器警告有关docinfo
狮身人面像2.2.11-id64-发布(95ae9a6)版权(c) 2001-2016年,Aksyonoff版权(c) 2008-2016年,狮身人面像技术公司(http://sphinxsearch.com) 使用配置文件‘/etc/sphinxsearch/sphinx.conf’.索引索引‘单词’..。警告:属性计数为0:切换到none docinfo收集了10000个文档,0.1MB排序为0.0MHITS,100.0%完成了总共10000个文档,79566字节总计0.065秒,1210829字节/秒,152179.20 docs /秒总计3读,0.000秒,94.6 kb/调用avg,0.0msec/call总计9次写入,0.000秒,47.5 kb/调用avg,0.0 msec/调用avg
但这里说,Sphinx: WARNING: Attribute count is 0: switching to none docinfo,这不是什么连载。
好的,开始服务并搜索单词的一部分:
SELECT *
FROM test_words
where match (name) AGAINST ('lema')
No rows.
Tha same as
SELECT *
FROM test_words
where match (name) AGAINST ('*lema*')没有排。
同时也有查询的结果。
SELECT *
FROM `test_words`
where position('lema' in name)>0据我所见-狮身人面像不是用一个词来搜索的。为什么以及如何修复它?
如果我取消评论
min_infix_len = 3
infix_fields = name我得到了
WARNING: index 'words': prefix_fields and infix_fields has no effect with dict=keywords, ignoring还有一个--显示引擎;没有显示狮身人面像引擎,现在正常吗?mysql服务重新启动。
所有sql查询都通过登入localhost的Adminer运行:3312
发布于 2018-10-04 10:57:06
在Sphinx中,没有任何函数像There()这样的函数,也没有类似于“match(Name)name”的语法。根据您的配置,您的索引是“word”,而您的请求针对的是“test_words”,这是您构建索引的源表。所以在我看来,你不是连接到狮身人面像,而是连接到mysql。如果您希望在MySQL和狮身人面像尝试SphinxSE (http://sphinxsearch.com/docs/devel.html#sphinxse)之间进行更紧密的集成,那么它将显示在“显示引擎”中,或者如果您不想使用SphinxSE enable编译mysql,您可能想尝试Manticore搜索(狮身人面像的一个分支),因为它与默认编译在MySQL中的FEDERATED (engine.html)集成,您只需要正确地启动它就可以了。
如果您想使用狮身人面像传统方式,只需确保连接到它,而不是MySQL。
发布于 2021-11-24 03:18:05
在sphinx中,它调用扩展语法,您应该通过@field指定字段,尝试如下:
SELECT * FROM test_words
WHERE match('@name lema')http://sphinxsearch.com/docs/current.html#extended-syntax
https://stackoverflow.com/questions/52642859
复制相似问题