zend-frameworksolrzend-search-lucene

Zend service solr update document


In Zend_Service_Solr I can add or delete a record.

$solr->addDocument($document);

Is there any way that I can update a record. I couldn't find any document for that. Or is there any extension for doing the same.


Solution

  • In most cases updating a document in Solr is to add the same document again (with the same value for the uniqueKey field).

    It's possible to perform certain updates in more recent versions of Solr, but these require all fields to be stored (so that the document can just be re-added internally) and a custom update syntax. There are also some work in progress with non-textual DocValues being updatable without having to resubmit the complete document, but this is currently not in any released version of Solr.

    The best way to handle this is usually to just re-submit the document with updated values, and have a straight forward way of doing that in your application code.