FileDocCategorySizeDatePackage
Weight.javaAPI DocApache Lucene 1.4.31857Tue Mar 30 00:48:04 BST 2004org.apache.lucene.search

Weight

public interface Weight implements Serializable
Expert: Calculate query weights and build query scorers.

A Weight is constructed by a query, given a Searcher ({@link Query#createWeight(Searcher)}). The {@link #sumOfSquaredWeights()} method is then called on the top-level query to compute the query normalization factor (@link Similarity#queryNorm(float)}). This factor is then passed to {@link #normalize(float)}. At this point the weighting is complete and a scorer may be constructed by calling {@link #scorer(IndexReader)}.

Fields Summary
Constructors Summary
Methods Summary
public org.apache.lucene.search.Explanationexplain(org.apache.lucene.index.IndexReader reader, int doc)
An explanation of the score computation for the named document.

public org.apache.lucene.search.QuerygetQuery()
The query that this concerns.

public floatgetValue()
The weight for this query.

public voidnormalize(float norm)
Assigns the query normalization factor to this.

public org.apache.lucene.search.Scorerscorer(org.apache.lucene.index.IndexReader reader)
Constructs a scorer for this.

public floatsumOfSquaredWeights()
The sum of squared weights of contained query clauses.