Modifier and Type | Class and Description |
---|---|
static class |
QueryRescorer.QueryRescoreContext |
Modifier and Type | Field and Description |
---|---|
static Rescorer |
INSTANCE |
static java.lang.String |
NAME |
Constructor and Description |
---|
QueryRescorer() |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.search.Explanation |
explain(int topLevelDocId,
SearchContext context,
RescoreSearchContext rescoreContext,
org.apache.lucene.search.Explanation sourceExplanation)
Executes an
Explanation phase on the rescorer. |
void |
extractTerms(SearchContext context,
RescoreSearchContext rescoreContext,
java.util.Set<org.apache.lucene.index.Term> termsSet)
Extracts all terms needed to execute this
Rescorer . |
java.lang.String |
name()
Returns the name of this rescorer
|
RescoreSearchContext |
parse(XContentParser parser,
QueryShardContext context)
Parses the
RescoreSearchContext for this implementation |
org.apache.lucene.search.TopDocs |
rescore(org.apache.lucene.search.TopDocs topDocs,
SearchContext context,
RescoreSearchContext rescoreContext)
Modifies the result of the previously executed search (
TopDocs )
in place based on the given RescoreSearchContext . |
public static final Rescorer INSTANCE
public static final java.lang.String NAME
public java.lang.String name()
Rescorer
public org.apache.lucene.search.TopDocs rescore(org.apache.lucene.search.TopDocs topDocs, SearchContext context, RescoreSearchContext rescoreContext) throws java.io.IOException
Rescorer
TopDocs
)
in place based on the given RescoreSearchContext
.rescore
in interface Rescorer
topDocs
- the result of the previously executed searchcontext
- the current SearchContext
. This will never be null
.rescoreContext
- the RescoreSearchContext
. This will never be null
java.io.IOException
- if an IOException
occurs during rescoringpublic org.apache.lucene.search.Explanation explain(int topLevelDocId, SearchContext context, RescoreSearchContext rescoreContext, org.apache.lucene.search.Explanation sourceExplanation) throws java.io.IOException
Rescorer
Explanation
phase on the rescorer.explain
in interface Rescorer
topLevelDocId
- the global / top-level document ID to explaincontext
- the explanation for the results being fed to this rescorerrescoreContext
- context for this rescorersourceExplanation
- explanation of the source of the documents being fed into this rescorejava.io.IOException
- if an IOException
occurspublic RescoreSearchContext parse(XContentParser parser, QueryShardContext context) throws java.io.IOException
Rescorer
RescoreSearchContext
for this implementationparse
in interface Rescorer
parser
- the parser to read the context fromcontext
- the current shard contextRescoreSearchContext
java.io.IOException
- if an IOException
occurs while parsing the contextpublic void extractTerms(SearchContext context, RescoreSearchContext rescoreContext, java.util.Set<org.apache.lucene.index.Term> termsSet)
Rescorer
Rescorer
. This method
is executed in a distributed frequency collection roundtrip for
SearchType.DFS_QUERY_AND_FETCH
and
SearchType.DFS_QUERY_THEN_FETCH
extractTerms
in interface Rescorer