Class FetchSubPhase.HitContext

java.lang.Object
org.elasticsearch.search.fetch.FetchSubPhase.HitContext
Enclosing interface:
FetchSubPhase

public static class FetchSubPhase.HitContext
extends java.lang.Object
  • Constructor Summary

    Constructors
    Constructor Description
    HitContext​(SearchHit hit, org.apache.lucene.index.LeafReaderContext context, int docId)  
  • Method Summary

    Modifier and Type Method Description
    int docId()  
    SearchHit hit()  
    org.apache.lucene.index.LeafReader reader()  
    org.apache.lucene.index.LeafReaderContext readerContext()  
    void setSourceLookup​(SourceLookup sourceLookup)  
    SourceLookup sourceLookup()
    This lookup provides access to the source for the given hit document.
    org.apache.lucene.index.IndexReader topLevelReader()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HitContext

      public HitContext​(SearchHit hit, org.apache.lucene.index.LeafReaderContext context, int docId)
  • Method Details

    • hit

      public SearchHit hit()
    • reader

      public org.apache.lucene.index.LeafReader reader()
    • readerContext

      public org.apache.lucene.index.LeafReaderContext readerContext()
    • docId

      public int docId()
      Returns:
      the docId of this hit relative to the leaf reader context
    • sourceLookup

      public SourceLookup sourceLookup()
      This lookup provides access to the source for the given hit document. Note that it should always be set to the correct doc ID and LeafReaderContext. In most cases, the hit document's source is loaded eagerly at the start of the FetchPhase. This lookup will contain the preloaded source.
    • setSourceLookup

      public void setSourceLookup​(SourceLookup sourceLookup)
    • topLevelReader

      public org.apache.lucene.index.IndexReader topLevelReader()