有关SphinxSE和RT索引的一些问题
我考虑在我的一个项目中使用 Sphinx 搜索,因此我有一些与之相关的问题。
- 当使用SphinxSE和RT索引时,SphinxSE表中的每个UPDATE或INSERT都会更新索引,对吧?不需要调用索引器什么的?
- 我可以搜索标签(用户输入的文档关键字)和内容,并为标签匹配提供更多相关性吗?如果可能的话,我该如何实现标签搜索(现在我将它们放在单独的表中,例如倒排索引)
- 对于填充器属性,最好将它们的重复项粘贴到 SphinxSE 表或使用常规文档表中的 mysql 的填充器中有?
提前致谢!
I consider using Sphinx search in one of my projects so I have a few questions related to it.
- When using SphinxSE and RT index, every UPDATE or INSERT in the SphinxSE table will update the index, right? No need to call indexer or anything?
- Can I search on both tags (user entered keywords for a document) and the content and give more relevance to the tag matches? And if it's possible how do I implement the tag search (now I have them in separate tables like an inverted index)
- For the fillter attributes is it better to stick duplicates of them in the SphinxSE table or fillter using mysql from the regular documents table I have?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我终于明白了狮身人面像的事情是如何运作的。
在 1.10 中,您可以添加多个全文可搜索字段。我添加了标题、标签和内容。为标题、标签和内容赋予更多权重的查询如下所示:
SELECT SQL_NO_CACHE * FROM sphinx_docs WHERE query = '很多关键字;weights=3,2,1;';
我使用
SQL_NO_CACHE
告诉mysql不要缓存结果,因为在下次调用时我无法获取从sphinx返回的行数(SHOW STATUS LIKE 'sphinx_total_found')
最好让 sphinx 完成所有排序、填充并仅使用 mysql 来加入您需要更多信息的表。
另外我不得不说,我多次尝试将sphinxse插件添加到mysql但没有成功(无休止的等待时间),所以我切换到包含SphinxSE存储引擎的MariaDB 5.2.4。
OK, I finally understand how things work with the sphinx thing.
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'
)It's better to let sphinx do all the sorting, filltering and use mysql only to JOIN the table you need more info from.
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.