Module org.elasticsearch.server
Class StoredFieldLoader
java.lang.Object
org.elasticsearch.index.fieldvisitor.StoredFieldLoader
Generates a
LeafStoredFieldLoader
for a given lucene segment to load stored fields.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic StoredFieldLoader
Creates a new StoredFieldLoaderstatic StoredFieldLoader
empty()
Creates a no-op StoredFieldLoader that will not load any fields from diskstatic StoredFieldLoader
fromSpec
(StoredFieldsSpec spec) Creates a new StoredFieldLoader using a StoredFieldsSpecstatic StoredFieldLoader
Creates a new StoredFieldLoader using a StoredFieldsSpec that is optimized for loading documents in order.abstract LeafStoredFieldLoader
getLoader
(org.apache.lucene.index.LeafReaderContext ctx, int[] docs) Return aLeafStoredFieldLoader
for the given segment and document set The loader will use an internal lucene merge reader if the document set is of sufficient size and is contiguous.static StoredFieldLoader
Creates a StoredFieldLoader tuned for sequential reads of _source
-
Constructor Details
-
StoredFieldLoader
public StoredFieldLoader()
-
-
Method Details
-
getLoader
public abstract LeafStoredFieldLoader getLoader(org.apache.lucene.index.LeafReaderContext ctx, int[] docs) throws IOException Return aLeafStoredFieldLoader
for the given segment and document set The loader will use an internal lucene merge reader if the document set is of sufficient size and is contiguous. Callers may passnull
if the set is not known up front or if the merge reader optimisation will not apply.- Throws:
IOException
-
fieldsToLoad
- Returns:
- a list of fields that will be loaded for each document
-
fromSpec
Creates a new StoredFieldLoader using a StoredFieldsSpec -
create
Creates a new StoredFieldLoader- Parameters:
loadSource
- should this loader load the _source fieldfields
- a set of additional fields the loader should load
-
fromSpecSequential
Creates a new StoredFieldLoader using a StoredFieldsSpec that is optimized for loading documents in order. -
sequentialSource
Creates a StoredFieldLoader tuned for sequential reads of _source -
empty
Creates a no-op StoredFieldLoader that will not load any fields from disk
-