Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Class SortedSetDocValuesSyntheticFieldLoader
java.lang.Object
org.elasticsearch.index.mapper.SortedSetDocValuesSyntheticFieldLoader
- All Implemented Interfaces:
SourceLoader.SyntheticFieldLoader
- Direct Known Subclasses:
FlattenedSortedSetDocValuesSyntheticFieldLoader
public abstract class SortedSetDocValuesSyntheticFieldLoader
extends Object
implements SourceLoader.SyntheticFieldLoader
Load
_source
fields from SortedSetDocValues
.-
Nested Class Summary
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
ConstructorDescriptionSortedSetDocValuesSyntheticFieldLoader
(String name, String simpleName, String storedValuesName, boolean loadIgnoreMalformedValues) Build a loader from doc values and, optionally, a stored field. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.apache.lucene.util.BytesRef
convert
(org.apache.lucene.util.BytesRef value) Convert aBytesRef
read from the source into bytes to write to the xcontent.docValuesLoader
(org.apache.lucene.index.LeafReader reader, int[] docIdsInLeaf) Build something to load doc values for this field or returnnull
if there are no doc values for this field to load.boolean
hasValue()
Has this field loaded any values for this document?protected abstract org.apache.lucene.util.BytesRef
preserve
(org.apache.lucene.util.BytesRef value) Preservesbytes
returned byconvert(org.apache.lucene.util.BytesRef)
to by written later.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.
-
Constructor Details
-
SortedSetDocValuesSyntheticFieldLoader
public SortedSetDocValuesSyntheticFieldLoader(String name, String simpleName, @Nullable String storedValuesName, boolean loadIgnoreMalformedValues) Build a loader from doc values and, optionally, a stored field.- Parameters:
name
- the name of the field to load from doc valuessimpleName
- the name to give the field in the rendered_source
storedValuesName
- the name of a stored field to load or null if there aren't any stored field for this fieldloadIgnoreMalformedValues
- should we load values skipped byignore_malformed
-
-
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 reader, 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
-
convert
protected abstract org.apache.lucene.util.BytesRef convert(org.apache.lucene.util.BytesRef value) Convert aBytesRef
read from the source into bytes to write to the xcontent. This shouldn't make a deep copy if the conversion process itself doesn't require one. -
preserve
protected abstract org.apache.lucene.util.BytesRef preserve(org.apache.lucene.util.BytesRef value) Preservesbytes
returned byconvert(org.apache.lucene.util.BytesRef)
to by written later. This should make adeep copy
ifconvert(org.apache.lucene.util.BytesRef)
didn't.
-