I am trying to figure out whether it is possible to do a partial update on some solr documents but could not find any useful solution yet. Tried the following:
$client->setServlet(SolrClient::SEARCH_SERVLET_TYPE, "update");
$doc = new SolrInputDocument();
$doc->addField('keywords', '{set:'.$tag.'}');
$updateResponse = $client->addDocument($doc);
$updateResponse->getResponse()
Response:
SolrObject Object
(
[responseHeader] => SolrObject Object
(
[status] => 0
[QTime] => 2
)
)
Search output:
{
"url": "http://de.wikipedia.org/wiki/Bier",
"keywords": [
"{set:bier}",
],
"_version_": 1458395909033296000
}
Keywords is a multivalued field. Obviously, $doc->addfield()
converts my solr directive into a string, which is logical. So is there any method which allows me to pass 'set', 'add' or 'inc' to update specific fields?
thanks in advance!