FileDocCategorySizeDatePackage
BoostingTermQuery.javaAPI DocApache Lucene 2.2.05938Sat Jun 16 22:20:32 BST 2007org.apache.lucene.search.payloads

BoostingTermQuery

public class BoostingTermQuery extends SpanTermQuery
The BoostingTermQuery is very similar to the {@link org.apache.lucene.search.spans.SpanTermQuery} except that it factors in the value of the payload located at each of the positions where the {@link org.apache.lucene.index.Term} occurs.

In order to take advantage of this, you must override {@link org.apache.lucene.search.Similarity#scorePayload(byte[],int,int)} which returns 1 by default.

Payload scores are averaged across term occurrences in the document.

WARNING: The status of the Payloads feature is experimental. The APIs introduced here might change in the future and will not be supported anymore in such a case.

see
org.apache.lucene.search.Similarity#scorePayload(byte[], int, int)

Fields Summary
Constructors Summary
public BoostingTermQuery(Term term)

    super(term);
  
Methods Summary
protected org.apache.lucene.search.WeightcreateWeight(org.apache.lucene.search.Searcher searcher)

    return new BoostingTermWeight(this, searcher);
  
public booleanequals(java.lang.Object o)

    if (!(o instanceof BoostingTermQuery))
      return false;
    BoostingTermQuery other = (BoostingTermQuery) o;
    return (this.getBoost() == other.getBoost())
            && this.term.equals(other.term);