org.apache.lucene.search.function

Class ValueSourceQuery

public class ValueSourceQuery extends Query

Expert: A Query that sets the scores of document to the values obtained from a ValueSource.

The value source can be based on a (cached) value of an indexd field, but it can also be based on an external source, e.g. values read from an external database.

Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc).

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

Author: yonik

Constructor Summary
ValueSourceQuery(ValueSource valSrc)
Create a value source query
Method Summary
protected WeightcreateWeight(Searcher searcher)
booleanequals(Object o)
Returns true if o is equal to this.
voidextractTerms(Set terms)
inthashCode()
Returns a hash code value for this object.
Queryrewrite(IndexReader reader)
StringtoString(String field)

Constructor Detail

ValueSourceQuery

public ValueSourceQuery(ValueSource valSrc)
Create a value source query

Parameters: valSrc provides the values defines the function to be used for scoring

Method Detail

createWeight

protected Weight createWeight(Searcher searcher)

equals

public boolean equals(Object o)
Returns true if o is equal to this.

extractTerms

public void extractTerms(Set terms)

hashCode

public int hashCode()
Returns a hash code value for this object.

rewrite

public Query rewrite(IndexReader reader)

toString

public String toString(String field)
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.