Class StoredFieldLoader

java.lang.Object
org.elasticsearch.index.fieldvisitor.StoredFieldLoader

public abstract class StoredFieldLoader extends Object
Generates a LeafStoredFieldLoader for a given lucene segment to load stored fields.
  • Constructor Details

    • StoredFieldLoader

      public StoredFieldLoader()
  • Method Details

    • getLoader

      public abstract LeafStoredFieldLoader getLoader(org.apache.lucene.index.LeafReaderContext ctx, int[] docs)
      Return a LeafStoredFieldLoader 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 pass null if the set is not known up front or if the merge reader optimisation will not apply.
    • fieldsToLoad

      public abstract List<String> fieldsToLoad()
      Returns:
      a list of fields that will be loaded for each document
    • create

      public static StoredFieldLoader create(boolean loadSource, Set<String> fields)
      Creates a new StoredFieldLoader
      Parameters:
      loadSource - should this loader load the _source field
      fields - a set of additional fields the loader should load
    • empty

      public static StoredFieldLoader empty()
      Creates a no-op StoredFieldLoader that will not load any fields from disk