Package org.elasticsearch.search.rescore
Interface Rescorer
-
- All Known Implementing Classes:
QueryRescorer
public interface RescorerA query rescorer interface used to re-rank the Top-K results of a previously executed search. Subclasses should borrow heavily fromQueryRescorerbecause it is fairly well behaved and documents that tradeoffs that it is making. There is also anExampleRescorerthat is worth looking at.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Explanationexplain(int topLevelDocId, IndexSearcher searcher, RescoreContext rescoreContext, Explanation sourceExplanation)Executes anExplanationphase on the rescorer.TopDocsrescore(TopDocs topDocs, IndexSearcher searcher, RescoreContext rescoreContext)Modifies the result of the previously executed search (TopDocs) in place based on the givenRescoreContext.
-
-
-
Method Detail
-
rescore
TopDocs rescore(TopDocs topDocs, IndexSearcher searcher, RescoreContext rescoreContext) throws IOException
Modifies the result of the previously executed search (TopDocs) in place based on the givenRescoreContext.- Parameters:
topDocs- the result of the previously executed searchsearcher- the searcher used for this search. This will never benull.rescoreContext- theRescoreContext. This will never benull- Throws:
IOException- if anIOExceptionoccurs during rescoring
-
explain
Explanation explain(int topLevelDocId, IndexSearcher searcher, RescoreContext rescoreContext, Explanation sourceExplanation) throws IOException
Executes anExplanationphase on the rescorer.- Parameters:
topLevelDocId- the global / top-level document ID to explainsearcher- the searcher used for this search. This will never benull.rescoreContext- context for this rescorersourceExplanation- explanation of the source of the documents being fed into this rescore- Returns:
- the explain for the given top level document ID.
- Throws:
IOException- if anIOExceptionoccurs
-
-