7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://framework.zend.com/license/new-bsd
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to license@zend.com so we can send you a copy immediately.
16
* @package Zend_Search_Lucene
18
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
19
* @license http://framework.zend.com/license/new-bsd New BSD License
24
* Calculate query weights and build query scorers.
26
* A Weight is constructed by a query Query->createWeight().
27
* The sumOfSquaredWeights() method is then called on the top-level
28
* query to compute the query normalization factor Similarity->queryNorm(float).
29
* This factor is then passed to normalize(float). At this point the weighting
33
* @package Zend_Search_Lucene
35
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
36
* @license http://framework.zend.com/license/new-bsd New BSD License
38
abstract class Zend_Search_Lucene_Search_Weight
41
* Normalization factor.
42
* This value is stored only for query expanation purpose and not used in any other place
46
protected $_queryNorm;
51
* Weight value may be initialized in sumOfSquaredWeights() or normalize()
52
* because they both are invoked either in Query::_initWeight (for top-level query) or
53
* in corresponding methods of parent query's weights
61
* The weight for this query.
65
public function getValue()
71
* The sum of squared weights of contained query clauses.
75
abstract public function sumOfSquaredWeights();
78
* Assigns the query normalization factor to this.
82
abstract public function normalize($norm);