我考虑在我的一个项目中使用Sphinx搜索,因此我有一些与之相关的问题.
I consider using Sphinx search in one of my projects so I have a few questions related to it.
提前谢谢!
推荐答案好,我终于了解了狮身人面像是如何工作的.
OK, I finally understand how things work with the sphinx thing.
使用1.10,您可以添加多个全文本可搜索字段.我添加了标题,标签和内容.并赋予标题更多权重的查询,然后是标签,然后是内容,如下所示: SELECT SQL_NO_CACHE * FROM sphinx_docs WHERE query = 'a lot of keywords;weights=3,2,1;'; 我用SQL_NO_CACHE告诉mysql不要缓存它的结果,因为在下一次调用时,我无法获得从sphinx(SHOW STATUS LIKE 'sphinx_total_found')
With 1.10 you can add multiple FullText searchable fields. I added title, tags and content. And the query to give more weight to the title, then tags and then content looks like this: SELECT SQL_NO_CACHE * FROM sphinx_docs WHERE query = 'a lot of keywords;weights=3,2,1;'; I use the SQL_NO_CACHE to tell mysql not to cache the result of this, because on next calls I can't get the number of rows returned from sphinx (SHOW STATUS LIKE 'sphinx_total_found')
最好让sphinx进行所有排序,填充和仅使用mysql联接需要更多信息的表.
It's better to let sphinx do all the sorting, filltering and use mysql only to JOIN the table you need more info from.
此外,我不得不说,我多次尝试将sphinxse插件添加到mysql都没有成功(无休止的等待时间),所以我切换到了包含SphinxSE存储引擎的MariaDB 5.2.4.
In addition I have to say that I tried many times to add the sphinxse plugin to mysql without success (endless make waiting hours) so I switched to MariaDB 5.2.4 which includes the SphinxSE storage engine.
更多推荐
与SphinxSE和RT索引有关的一些问题
发布评论