Expert: Calculate query weights and build query scorers.

The purpose of {@link Weight} is to ensure searching does not modify a {@link Query}, so that a {@link Query} instance can be reused.
{@link Searcher} dependent state of the query should reside in the {@link Weight}.
{@link IndexReader} dependent state should reside in the {@link Scorer}.

A

CopyC#
Weight
is used in the following way:
  1. A
    CopyC#
    Weight
    is constructed by a top-level query, given a
    CopyC#
    Searcher
    ({@link Query#CreateWeight(Searcher)}).
  2. The {@link #SumOfSquaredWeights()} method is called on the
    CopyC#
    Weight
    to compute the query normalization factor {@link Similarity#QueryNorm(float)} of the query clauses contained in the query.
  3. The query normalization factor is passed to {@link #Normalize(float)}. At this point the weighting is complete.
  4. A
    CopyC#
    Scorer
    is constructed by {@link #Scorer(IndexReader,boolean,boolean)}.

Namespace: Lucene.Net.Search
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
[SerializableAttribute]
public abstract class Weight
Visual Basic
<SerializableAttribute> _
Public MustInherit Class Weight
Visual C++
[SerializableAttribute]
public ref class Weight abstract

Inheritance Hierarchy

See Also