Class PayloadScoreQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.queries.spans.SpanQuery
org.apache.lucene.queries.payloads.PayloadScoreQuery
A Query class that uses a
PayloadFunction to modify the score of a wrapped SpanQuery. A wrapped span query is used due to the way that payload values are indexed, see
PostingsEnum.PAYLOADS.-
Constructor Summary
ConstructorsConstructorDescriptionPayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function, PayloadDecoder decoder) Creates a new PayloadScoreQuery that includes the underlying span scoresPayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function, PayloadDecoder decoder, boolean includeSpanScore) Creates a new PayloadScoreQuery -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) booleangetField()Returns the name of the field matched by this query.inthashCode()rewrite(IndexSearcher indexSearcher) voidvisit(QueryVisitor visitor) Methods inherited from class org.apache.lucene.queries.spans.SpanQuery
getTermStates, getTermStatesMethods inherited from class org.apache.lucene.search.Query
classHash, sameClassAs, toString
-
Constructor Details
-
PayloadScoreQuery
public PayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function, PayloadDecoder decoder, boolean includeSpanScore) Creates a new PayloadScoreQuery- Parameters:
wrappedQuery- the query to wrapfunction- a PayloadFunction to use to modify the scoresdecoder- a PayloadDecoder to convert payloads into float valuesincludeSpanScore- include both span score and payload score in the scoring algorithm
-
PayloadScoreQuery
Creates a new PayloadScoreQuery that includes the underlying span scores- Parameters:
wrappedQuery- the query to wrapfunction- a PayloadFunction to use to modify the scores
-
-
Method Details
-
getField
Description copied from class:SpanQueryReturns the name of the field matched by this query. -
rewrite
- Overrides:
rewritein classQuery- Throws:
IOException
-
visit
-
toString
-
createWeight
public SpanWeight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException - Specified by:
createWeightin classSpanQuery- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-