Calculate query weights and build query scorers.

A Weight is constructed by a query Query->createWeight(). The sumOfSquaredWeights() method is then called on the top-level query to compute the query normalization factor Similarity->queryNorm(float). This factor is then passed to normalize(float). At this point the weighting is complete.

category Zend
package Zend_Search_Lucene
subpackage Search
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Search_Lucene_Search_Weight

 Methods

Zend_Search_Lucene_Search_Weight_MultiTerm constructor query - the query that this concerns.

__construct(\Zend_Search_Lucene_Search_Query $query, \Zend_Search_Lucene_Interface $reader) 

reader - index reader

Parameters

$query

\Zend_Search_Lucene_Search_Query

$reader

\Zend_Search_Lucene_Interface

The weight for this query Standard Weight::$_value is not used for boolean queries

getValue() : float
inherited_from \Zend_Search_Lucene_Search_Weight::getValue()

Returns

float

The weight for this query.

getValue() : float
Inherited

Returns

float

Assigns the query normalization factor to this.

normalize(float $queryNorm) 
inherited_from \Zend_Search_Lucene_Search_Weight::normalize()

Parameters

$queryNorm

float

Assigns the query normalization factor to this.

normalize(float $norm) 
Inherited

Parameters

$norm

float

The sum of squared weights of contained query clauses.

sumOfSquaredWeights() : float
inherited_from \Zend_Search_Lucene_Search_Weight::sumOfSquaredWeights()

Returns

float

The sum of squared weights of contained query clauses.

sumOfSquaredWeights() : float
Inherited

Returns

float

 Properties

 

Normalization factor.

$_queryNorm : float

Default

This value is stored only for query expanation purpose and not used in any other place

 

Weight value

$_value : float

Default

Weight value may be initialized in sumOfSquaredWeights() or normalize() because they both are invoked either in Query::_initWeight (for top-level query) or in corresponding methods of parent query's weights

 

The query that this concerns.

$_query : \Zend_Search_Lucene_Search_Query

Default

 

IndexReader.

$_reader : \Zend_Search_Lucene_Interface

Default

 

Query terms weights Array of Zend_Search_Lucene_Search_Weight_Term

$_weights : array

Default