HumHub Documentation (unofficial)

AbstractWeight
in package

AbstractYes

Calculate query weights and build query scorers.

A AbstractWeight 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.

Tags
category

Zend

subpackage

Search

Table of Contents

Properties

$_queryNorm  : float
Normalization factor.
$_value  : float
AbstractWeight value

Methods

getValue()  : float
The weight for this query.
normalize()  : mixed
Assigns the query normalization factor to this.
sumOfSquaredWeights()  : float
The sum of squared weights of contained query clauses.

Properties

$_queryNorm

Normalization factor.

protected float $_queryNorm

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

$_value

AbstractWeight value

protected float $_value

AbstractWeight 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

Methods

getValue()

The weight for this query.

public getValue() : float
Return values
float

normalize()

Assigns the query normalization factor to this.

public abstract normalize(mixed $norm) : mixed
Parameters
$norm : mixed

sumOfSquaredWeights()

The sum of squared weights of contained query clauses.

public abstract sumOfSquaredWeights() : float
Return values
float

        
On this page

Search results