Class PayloadTermQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.search.spans.SpanQuery
-
- org.apache.lucene.search.spans.SpanTermQuery
-
- org.apache.lucene.search.payloads.PayloadTermQuery
-
- All Implemented Interfaces:
java.lang.Cloneable
public class PayloadTermQuery extends SpanTermQuery
This class is very similar toSpanTermQuery
except that it factors in the value of the payload located at each of the positions where theTerm
occurs. NOTE: In order to take advantage of this with the default scoring implementation (DefaultSimilarity
), you must overrideDefaultSimilarity.scorePayload(int, int, int, BytesRef)
, which returns 1 by default. Payload scores are aggregated using a pluggablePayloadFunction
.
-
-
Constructor Summary
Constructors Constructor Description PayloadTermQuery(Term term, PayloadFunction function)
PayloadTermQuery(Term term, PayloadFunction function, boolean includeSpanScore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Weight
createWeight(IndexSearcher searcher)
Expert: Constructs an appropriate Weight implementation for this query.boolean
equals(java.lang.Object obj)
int
hashCode()
-
Methods inherited from class org.apache.lucene.search.spans.SpanTermQuery
extractTerms, getField, getSpans, getTerm, toString
-
-
-
-
Constructor Detail
-
PayloadTermQuery
public PayloadTermQuery(Term term, PayloadFunction function)
-
PayloadTermQuery
public PayloadTermQuery(Term term, PayloadFunction function, boolean includeSpanScore)
-
-
Method Detail
-
createWeight
public Weight createWeight(IndexSearcher searcher) throws java.io.IOException
Description copied from class:Query
Expert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeight
in classSpanQuery
- Throws:
java.io.IOException
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classSpanTermQuery
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classSpanTermQuery
-
-