Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Class CompositeSyntheticFieldLoader
java.lang.Object
org.elasticsearch.index.mapper.CompositeSyntheticFieldLoader
- All Implemented Interfaces:
SourceLoader.SyntheticFieldLoader
public class CompositeSyntheticFieldLoader
extends Object
implements SourceLoader.SyntheticFieldLoader
A
SourceLoader.SyntheticFieldLoader
that uses a set of sub-loaders
to produce synthetic source for the field.
Typical use case is to gather field values from doc_values and append malformed values
stored in a different field in case of ignore_malformed being enabled.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
Represents one layer of loading synthetic source values for a field as a part ofCompositeSyntheticFieldLoader
.static class
Layer that loads malformed values stored in a dedicated field with a conventional name.static class
Layer that loads field values from a provided stored field.Nested classes/interfaces inherited from interface org.elasticsearch.index.mapper.SourceLoader.SyntheticFieldLoader
SourceLoader.SyntheticFieldLoader.DocValuesLoader, SourceLoader.SyntheticFieldLoader.StoredFieldLoader
-
Field Summary
Fields inherited from interface org.elasticsearch.index.mapper.SourceLoader.SyntheticFieldLoader
NOTHING
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeSyntheticFieldLoader
(String leafFieldName, String fullFieldName, Collection<CompositeSyntheticFieldLoader.Layer> parts) CompositeSyntheticFieldLoader
(String leafFieldName, String fullFieldName, CompositeSyntheticFieldLoader.Layer... parts) -
Method Summary
Modifier and TypeMethodDescriptiondocValuesLoader
(org.apache.lucene.index.LeafReader leafReader, int[] docIdsInLeaf) Build something to load doc values for this field or returnnull
if there are no doc values for this field to load.Returns the canonical field name for this loader.boolean
hasValue()
Has this field loaded any values for this document?void
reset()
Resets the loader to remove any stored data and prepare it for processing new document.AStream
mapping stored field paths to a place to put them so they can be included in the next document.void
Write values for this document.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.index.mapper.SourceLoader.SyntheticFieldLoader
setIgnoredValues
-
Constructor Details
-
CompositeSyntheticFieldLoader
public CompositeSyntheticFieldLoader(String leafFieldName, String fullFieldName, CompositeSyntheticFieldLoader.Layer... parts) -
CompositeSyntheticFieldLoader
public CompositeSyntheticFieldLoader(String leafFieldName, String fullFieldName, Collection<CompositeSyntheticFieldLoader.Layer> parts)
-
-
Method Details
-
storedFieldLoaders
public Stream<Map.Entry<String,SourceLoader.SyntheticFieldLoader.StoredFieldLoader>> storedFieldLoaders()Description copied from interface:SourceLoader.SyntheticFieldLoader
AStream
mapping stored field paths to a place to put them so they can be included in the next document.- Specified by:
storedFieldLoaders
in interfaceSourceLoader.SyntheticFieldLoader
-
docValuesLoader
public SourceLoader.SyntheticFieldLoader.DocValuesLoader docValuesLoader(org.apache.lucene.index.LeafReader leafReader, int[] docIdsInLeaf) throws IOException Description copied from interface:SourceLoader.SyntheticFieldLoader
Build something to load doc values for this field or returnnull
if there are no doc values for this field to load.- Specified by:
docValuesLoader
in interfaceSourceLoader.SyntheticFieldLoader
docIdsInLeaf
- can be null.- Throws:
IOException
-
hasValue
public boolean hasValue()Description copied from interface:SourceLoader.SyntheticFieldLoader
Has this field loaded any values for this document?- Specified by:
hasValue
in interfaceSourceLoader.SyntheticFieldLoader
-
write
Description copied from interface:SourceLoader.SyntheticFieldLoader
Write values for this document.- Specified by:
write
in interfaceSourceLoader.SyntheticFieldLoader
- Throws:
IOException
-
reset
public void reset()Description copied from interface:SourceLoader.SyntheticFieldLoader
Resets the loader to remove any stored data and prepare it for processing new document. This is an alternative code path toSourceLoader.SyntheticFieldLoader.write(org.elasticsearch.xcontent.XContentBuilder)
that is executed when values are loaded but not written. Loaders are expected to also reset their state after writing currently present data.- Specified by:
reset
in interfaceSourceLoader.SyntheticFieldLoader
-
fieldName
Description copied from interface:SourceLoader.SyntheticFieldLoader
Returns the canonical field name for this loader.- Specified by:
fieldName
in interfaceSourceLoader.SyntheticFieldLoader
-