Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * 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);
     }
 }
Beispiel #3
0
 /**
  * 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;
 }