File: solrinputdocument_update_partial.php

package info (click to toggle)
php-solr 2.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,620 kB
  • sloc: ansic: 14,274; xml: 1,313; php: 1,239; pascal: 11; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 590 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php 

$doc = new SolrInputDocument();
$doc->addField('id', 'my_long_doc_id');
$doc->updateField('field1', SolrInputDocument::UPDATE_MODIFIER_ADD, 'newly added value');
$doc->updateField('field1', SolrInputDocument::UPDATE_MODIFIER_REMOVE, 'remove me please');
$doc->updateField('field3_i', SolrInputDocument::UPDATE_MODIFIER_INC, 5);
$doc->updateField('field2_s', SolrInputDocument::UPDATE_MODIFIER_SET, 'updated string');
$doc->updateField('field1', SolrInputDocument::UPDATE_MODIFIER_REMOVEREGEX, '[\d]{2}/[\d]{2}/[\d]{4}');



$response = $client->addDocument($doc);
$client->commit();