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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StoredFieldLoaderCreates a new StoredFieldLoaderstatic StoredFieldLoaderempty()Creates a no-op StoredFieldLoader that will not load any fields from diskstatic StoredFieldLoaderfromSpec(StoredFieldsSpec spec) Creates a new StoredFieldLoader using a StoredFieldsSpecstatic StoredFieldLoaderCreates a new StoredFieldLoader using a StoredFieldsSpec that is optimized for loading documents in order.abstract LeafStoredFieldLoadergetLoader(org.apache.lucene.index.LeafReaderContext ctx, int[] docs) Return aLeafStoredFieldLoaderfor 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 StoredFieldLoaderCreates 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 aLeafStoredFieldLoaderfor 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 passnullif 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
-