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-2009 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: Weight.php 16541 2009-07-07 06:59:03Z bkarwin $
25 * Calculate query weights and build query scorers.
27 * A Weight is constructed by a query Query->createWeight().
28 * The sumOfSquaredWeights() method is then called on the top-level
29 * query to compute the query normalization factor Similarity->queryNorm(float).
30 * This factor is then passed to normalize(float). At this point the weighting
34 * @package Zend_Search_Lucene
36 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
37 * @license http://framework.zend.com/license/new-bsd New BSD License
39 abstract class Zend_Search_Lucene_Search_Weight
42 * Normalization factor.
43 * This value is stored only for query expanation purpose and not used in any other place
47 protected $_queryNorm;
52 * Weight value may be initialized in sumOfSquaredWeights() or normalize()
53 * because they both are invoked either in Query::_initWeight (for top-level query) or
54 * in corresponding methods of parent query's weights
62 * The weight for this query.
66 public function getValue()
72 * The sum of squared weights of contained query clauses.
76 abstract public function sumOfSquaredWeights();
79 * Assigns the query normalization factor to this.
83 abstract public function normalize($norm);