SOLR-9530: documentation added

This commit is contained in:
Noble Paul 2017-06-08 15:57:14 +09:30
parent bd2203df93
commit ce5b184b17
1 changed files with 21 additions and 1 deletions

View File

@ -379,13 +379,14 @@ These are listed for completeness, but are part of the Solr infrastructure, part
[[UpdateRequestProcessors-UpdateProcessorsThatCanBeUsedatRuntime]]
=== Update Processors That Can Be Used at Runtime
These Update processors do not need any configuration is your `solrconfig.xml` . They are automatically initialized when their name is added to the `processor` parameter. Multiple processors can be used by appending multiple processor names (comma separated)
[[UpdateRequestProcessors-TemplateUpdateProcessorFactory]]
==== TemplateUpdateProcessorFactory
The `TemplateUpdateProcessorFactory` can be used to add new fields to documents based on a template pattern.
This can be used directly in a request without any configuration. To enable this processor, use the parameter `processor=Template`. The template parameter `Template.field` (multivalued) define the field to add and the pattern. Templates may contain placeholders which refer to other fields in the document. You can have multiple `Template.field` parameters in a single request.
Use the parameter `processor=Template` to use it. The template parameter `Template.field` (multivalued) define the field to add and the pattern. Templates may contain placeholders which refer to other fields in the document. You can have multiple `Template.field` parameters in a single request.
For example:
@ -395,3 +396,22 @@ processor=Template&Template.field=fullName:Mr. ${firstName} ${lastName}
----
The above example would add a new field to the document called `fullName`. The fields `firstName and` `lastName` are supplied from the document fields. If either of them is missing, that part is replaced with an empty string. If those fields are multi-valued, only the first value is used.
==== AtomicUpdateProcessorFactory
Use it to convert your normal `update` operations to atomic update operations. This is particularly useful when you use endpoints such as `/update/csv` or `/update/json/docs` which does not support syntax for atomic operations.
example:
[source,bash]
----
processor=Atomic&Atomic.field1=add&Atomic.field2=set&Atomic.field3=inc&Atomic.field4=remove&Atomic.field4=remove
----
The above parameters convert a normal `update` operation on
* `field1` to an atomic `add` operation
* `field2` to an atomic `set` operation
* `field3` to an atomic `inc` operation
* `field4` to an atomic `remove` operation