简体   繁体   中英

PHP Solr PECL Extension Support Field Updating

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:

http://pecl.php.net/package/solr

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

http://www.php.net/manual/en/book.solr.php

and in particular the documentation for addDocument here:

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

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?

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 allowDups and 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM