1

我现在正在做一个项目,它有一个计数和 ID 的 solr 索引。我目前正在研究是否可以直接在 solr 上递增/递减,而不必检索数据,用 PHP 递增,然后将其重新插入 solr。

我花了一个小时在谷歌上搜索这个变化无济于事。任何信息将不胜感激。

谢谢。

4

1 回答 1

2

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.

于 2010-10-18T20:41:39.487 回答