Class PayloadScoreQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.search.spans.SpanQuery
-
- org.apache.lucene.queries.payloads.PayloadScoreQuery
-
public class PayloadScoreQuery extends SpanQuery
A Query class that uses aPayloadFunction
to modify the score of a wrapped SpanQuery
-
-
Constructor Summary
Constructors Constructor Description PayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function)
Deprecated.PayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function, boolean includeSpanScore)
PayloadScoreQuery(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpanWeight
createWeight(IndexSearcher searcher, boolean needsScores, float boost)
boolean
equals(Object other)
String
getField()
int
hashCode()
Query
rewrite(IndexReader reader)
String
toString(String field)
-
Methods inherited from class org.apache.lucene.search.spans.SpanQuery
getTermContexts, getTermContexts
-
Methods inherited from class org.apache.lucene.search.Query
classHash, sameClassAs, toString
-
-
-
-
Constructor Detail
-
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
@Deprecated public PayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function, boolean includeSpanScore)
Creates a new PayloadScoreQuery- Parameters:
wrappedQuery
- the query to wrapfunction
- a PayloadFunction to use to modify the scoresincludeSpanScore
- include both span score and payload score in the scoring algorithm
-
PayloadScoreQuery
public PayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function, PayloadDecoder decoder)
Creates a new PayloadScoreQuery that includes the underlying span scores- Parameters:
wrappedQuery
- the query to wrapfunction
- a PayloadFunction to use to modify the scores
-
PayloadScoreQuery
@Deprecated public PayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function)
Deprecated.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 Detail
-
rewrite
public Query rewrite(IndexReader reader) throws IOException
- Overrides:
rewrite
in classQuery
- Throws:
IOException
-
createWeight
public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException
- Specified by:
createWeight
in classSpanQuery
- Throws:
IOException
-
-