solr可以用来递增/递减吗?
我现在正在开发一个项目,该项目具有计数和 ID 的 solr 索引。我目前正在研究是否可以直接在 solr 上递增/递减,而不必检索数据,用 PHP 递增它,然后将其重新插入到 solr 中。
我花了一个小时在谷歌上搜索此内容的变体,但无济于事。任何信息将不胜感激。
谢谢。
I am working on a project right now that has a solr index of counts and ids. I am currently researching if it is possible to increment/decrement on solr directly, instead of having to retrieve the data, increment it with PHP, and then reinsert it into solr.
I have spent an hour googling variations of this to no avail. Any information would be most appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,据我所知这是不可能的。您当然可以在 Solr 中将其实现为请求处理程序,该处理程序将从底层 Lucene 索引检索文档,更新字段,然后将其写回索引并提交,但过于频繁地执行此操作可能会降低性能。这并不是 Lucene/Solr 的真正设计目的。对于这个特定功能,请考虑使用 Redis 之类的东西,而将 Lucene/Solr 留给全文搜索,这是它真正发挥作用的地方。
No, as far as I know it's not possible. You could certainly implement this in Solr as a request handler, which would retrieve the document from the underlying Lucene index, update the field, then write it back to the index and commit, but doing this too frequently will probably kill your performance. This is not really what Lucene/Solr were designed for. Consider using something like Redis instead, for this particular feature, and leave Lucene/Solr for full-text search, where it really shines.