PayloadScoreQuery
to wrap SpanTermQuery
public class PayloadTermQuery extends SpanTermQuery
SpanTermQuery
except that it factors
in the value of the payload located at each of the positions where the
Term
occurs.
NOTE: In order to take advantage of this with the default scoring implementation
(DefaultSimilarity
), you must override DefaultSimilarity.scorePayload(int, int, int, BytesRef)
,
which returns 1 by default.
Payload scores are aggregated using a pluggable PayloadFunction
.
SpanTermQuery.SpanTermWeight
Modifier and Type | Field and Description |
---|---|
protected PayloadFunction |
function
Deprecated.
|
term, termContext
Constructor and Description |
---|
PayloadTermQuery(Term term,
PayloadFunction function)
Deprecated.
|
PayloadTermQuery(Term term,
PayloadFunction function,
boolean includeSpanScore)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
SpanWeight |
createWeight(IndexSearcher searcher,
boolean needsScores)
Deprecated.
Create a SpanWeight for this query
|
boolean |
equals(Object obj)
Deprecated.
|
int |
hashCode()
Deprecated.
|
getField, getTerm, toString
getTermContexts, getTermContexts
protected PayloadFunction function
public PayloadTermQuery(Term term, PayloadFunction function)
public PayloadTermQuery(Term term, PayloadFunction function, boolean includeSpanScore)
public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
SpanQuery
createWeight
in class SpanTermQuery
searcher
- the IndexSearcher to be searched acrossneedsScores
- if the query needs scoresIOException
- on errorpublic int hashCode()
hashCode
in class SpanTermQuery
public boolean equals(Object obj)
equals
in class SpanTermQuery
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.