solr可以用来递增/递减吗?

发布于 2024-09-28 07:46:54 字数 160 浏览 2 评论 0原文

我现在正在开发一个项目,该项目具有计数和 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自由范儿 2024-10-05 07:46:54

不,据我所知这是不可能的。您当然可以在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文