2014-06-25 18:11
浏览 82

PHP Solr PECL扩展支持字段更新

Based on information I found in this SO answer:

Update specific field on SOLR index

as of Solr 4.0, updating specific fields of a Solr document is possible via its HTTP API.

Looking on the PHP Solr PECL extension page here:


seems to imply that Solr 4.0 feature support has been added. I looked through the documentation for the extension here:


and in particular the documentation for addDocument here:


but it does not seem to indicate whether or not "overwriting" a document means deleting it and then adding the current document, or updating fields individually. There does not appear to be any methods specifically meant to update fields either.

Does anyone know if the extension has the capability of updating field values without deleting the document?

图片转代码服务由CSDN问答提供 功能建议



Solr 4.0,可以通过HTTP API更新Solr文档的特定字段。

在此处查看PHP Solr PECL扩展页面:


似乎暗示已添加Solr 4.0功能支持。 我在这里查看了扩展文档:



http://www.php.net/manual /en/solrclient.adddocument.php

但它似乎并不表示“覆盖”文档是否意味着删除它然后添加当前文档或更新 单独的领域。 似乎没有任何专门用于更新字段的方法。


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doujiang2812 2014-06-26 12:55

    There is nothing in the changelog indicating that the php_solr extension supports updating single fields (field updates has a few requirements for your schema as well). I'd say that it hasn't been a priority, as it's not much different from just submitting the document again (which your toolchain should be able to do).

    overwrite replaces allowDupsand two other settings related to the XML update messages in Solr4.0, but is not related to field level updates - just what action you want to take when the uniqueKey already exists in the index.

    点赞 打赏 评论

相关推荐 更多相似问题