org.apache.lucene.search.payloads
Class BoostingTermQuery

java.lang.Object
  extended by org.apache.lucene.search.Query
      extended by org.apache.lucene.search.spans.SpanQuery
          extended by org.apache.lucene.search.spans.SpanTermQuery
              extended by org.apache.lucene.search.payloads.BoostingTermQuery
All Implemented Interfaces:
Serializable, Cloneable

public class BoostingTermQuery
extends SpanTermQuery

The BoostingTermQuery is very similar to the SpanTermQuery except that it factors in the value of the payload located at each of the positions where the Term occurs.

In order to take advantage of this, you must override Similarity.scorePayload(String, byte[],int,int) which returns 1 by default.

Payload scores are averaged across term occurrences in the document.

See Also:
Similarity.scorePayload(String, byte[], int, int), Serialized Form

Nested Class Summary
protected  class BoostingTermQuery.BoostingTermWeight
           
 
Field Summary
 
Fields inherited from class org.apache.lucene.search.spans.SpanTermQuery
term
 
Constructor Summary
BoostingTermQuery(Term term)
           
 
Method Summary
protected  Weight createWeight(Searcher searcher)
          Expert: Constructs an appropriate Weight implementation for this query.
 boolean equals(Object o)
          Returns true iff o is equal to this.
 
Methods inherited from class org.apache.lucene.search.spans.SpanTermQuery
extractTerms, getField, getPayloadSpans, getSpans, getTerm, getTerms, hashCode, toString
 
Methods inherited from class org.apache.lucene.search.Query
clone, combine, getBoost, getSimilarity, mergeBooleanQueries, rewrite, setBoost, toString, weight
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoostingTermQuery

public BoostingTermQuery(Term term)
Method Detail

createWeight

protected Weight createWeight(Searcher searcher)
                       throws 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 class SpanQuery
Throws:
IOException

equals

public boolean equals(Object o)
Description copied from class: SpanTermQuery
Returns true iff o is equal to this.

Overrides:
equals in class SpanTermQuery


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.