Package org.elasticsearch.search.fetch
Class FetchSubPhase.HitContext
java.lang.Object
org.elasticsearch.search.fetch.FetchSubPhase.HitContext
- Enclosing interface:
- FetchSubPhase
-
Constructor Summary
ConstructorsConstructorDescriptionHitContext(SearchHit hit, org.apache.lucene.index.LeafReaderContext context, int docId) -
Method Summary
Modifier and TypeMethodDescriptionintdocId()hit()org.apache.lucene.index.LeafReaderreader()org.apache.lucene.index.LeafReaderContextvoidsetSourceLookup(SourceLookup sourceLookup)This lookup provides access to the source for the given hit document.org.apache.lucene.index.IndexReader
-
Constructor Details
-
HitContext
-
-
Method Details
-
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
This lookup provides access to the source for the given hit document. Note that it should always be set to the correct doc ID andLeafReaderContext. In most cases, the hit document's source is loaded eagerly at the start of theFetchPhase. This lookup will contain the preloaded source. -
setSourceLookup
-
topLevelReader
public org.apache.lucene.index.IndexReader topLevelReader()
-