/** * The sum of squared weights of contained query clauses. * * @return float */ public function sumOfSquaredWeights() { // compute idf $this->_idf = $this->_reader->getSimilarity()->idf($this->_term, $this->_reader); // compute query weight $this->_queryWeight = $this->_idf * $this->_query->getBoost(); // square it return $this->_queryWeight * $this->_queryWeight; }
/** * Assigns the query normalization factor to this. * * @param float $queryNorm */ public function normalize($queryNorm) { // incorporate boost $queryNorm *= $this->_query->getBoost(); foreach ($this->_weights as $weight) { $weight->normalize($queryNorm); } }
/** * Transform entry to a subquery * * @param string $encoding * @return \ZendSearch\Lucene\Search\Query\AbstractQuery */ public function getQuery($encoding) { $this->_query->setBoost($this->_boost); return $this->_query; }