public class AtomicUpdateDocumentMerger extends Object
Modifier and Type | Field and Description |
---|---|
protected SchemaField |
idField |
protected IndexSchema |
schema |
Constructor and Description |
---|
AtomicUpdateDocumentMerger(SolrQueryRequest queryReq) |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
computeInPlaceUpdatableFields(AddUpdateCommand cmd)
Given an add update command, compute a list of fields that can be updated in-place.
|
protected void |
doAdd(SolrInputDocument toDoc,
SolrInputField sif,
Object fieldVal) |
protected void |
doAddDistinct(SolrInputDocument toDoc,
SolrInputField sif,
Object fieldVal) |
protected void |
doInc(SolrInputDocument toDoc,
SolrInputField sif,
Object fieldVal) |
boolean |
doInPlaceUpdateMerge(AddUpdateCommand cmd,
Set<String> updatedFields)
Given an AddUpdateCommand containing update operations (e.g.
|
protected void |
doRemove(SolrInputDocument toDoc,
SolrInputField sif,
Object fieldVal) |
protected void |
doRemoveRegex(SolrInputDocument toDoc,
SolrInputField sif,
Object valuePatterns) |
protected void |
doSet(SolrInputDocument toDoc,
SolrInputField sif,
Object fieldVal) |
static SolrInputField |
getFieldFromHierarchy(SolrInputDocument completeHierarchy,
String fieldPath) |
static boolean |
isAtomicUpdate(AddUpdateCommand cmd)
Utility method that examines the SolrInputDocument in an AddUpdateCommand
and returns true if the documents contains atomic update instructions.
|
static boolean |
isDerivedFromDoc(SolrInputDocument fullDoc,
SolrInputDocument partialDoc) |
static boolean |
isSupportedFieldForInPlaceUpdate(SchemaField schemaField)
Given a schema field, return whether or not such a field is supported for an in-place update.
|
SolrInputDocument |
merge(SolrInputDocument sdoc,
SolrInputDocument toDoc)
Merges the fromDoc into the toDoc using the atomic update syntax.
|
protected final IndexSchema schema
protected final SchemaField idField
public AtomicUpdateDocumentMerger(SolrQueryRequest queryReq)
public static boolean isAtomicUpdate(AddUpdateCommand cmd)
public SolrInputDocument merge(SolrInputDocument sdoc, SolrInputDocument toDoc)
toDoc
itself) with an
equal ID, and merge into that one.sdoc
- the doc containing update instructionstoDoc
- the target doc (possibly nested) before the update (will be modified in-place)public static boolean isSupportedFieldForInPlaceUpdate(SchemaField schemaField)
public static Set<String> computeInPlaceUpdatableFields(AddUpdateCommand cmd) throws IOException
IOException
public static boolean isDerivedFromDoc(SolrInputDocument fullDoc, SolrInputDocument partialDoc)
fullDoc
- the full doc to be compared againstpartialDoc
- the sub document to be testedpublic static SolrInputField getFieldFromHierarchy(SolrInputDocument completeHierarchy, String fieldPath)
completeHierarchy
- SolrInputDocument that represents the nested document hierarchy from its rootfieldPath
- the path to fetch, separated by a '/' e.g. /children/grandChildrenpublic boolean doInPlaceUpdateMerge(AddUpdateCommand cmd, Set<String> updatedFields) throws IOException
IOException
protected void doSet(SolrInputDocument toDoc, SolrInputField sif, Object fieldVal)
protected void doAdd(SolrInputDocument toDoc, SolrInputField sif, Object fieldVal)
protected void doAddDistinct(SolrInputDocument toDoc, SolrInputField sif, Object fieldVal)
protected void doInc(SolrInputDocument toDoc, SolrInputField sif, Object fieldVal)
protected void doRemove(SolrInputDocument toDoc, SolrInputField sif, Object fieldVal)
protected void doRemoveRegex(SolrInputDocument toDoc, SolrInputField sif, Object valuePatterns)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.