Example #1
0
 /**
  * Zend_Search_Lucene_Search_Weight_Boolean constructor
  * query - the query that this concerns.
  * reader - index reader
  *
  * @param Zend_Search_Lucene_Search_Query $query
  * @param Zend_Search_Lucene_Interface    $reader
  */
 public function __construct(Zend_Search_Lucene_Search_Query $query, Zend_Search_Lucene_Interface $reader)
 {
     $this->_query = $query;
     $this->_reader = $reader;
     $this->_weights = array();
     $signs = $query->getSigns();
     foreach ($query->getSubqueries() as $num => $subquery) {
         if ($signs === null || $signs[$num] === null || $signs[$num]) {
             $this->_weights[$num] = $subquery->createWeight($reader);
         }
     }
 }
Example #2
0
 /**
  * Zend_Search_Lucene_Search_Weight_MultiTerm constructor
  * query - the query that this concerns.
  * reader - index reader
  *
  * @param Zend_Search_Lucene_Search_Query $query
  * @param Zend_Search_Lucene_Interface    $reader
  */
 public function __construct(Zend_Search_Lucene_Search_Query $query, Zend_Search_Lucene_Interface $reader)
 {
     $this->_query = $query;
     $this->_reader = $reader;
     $this->_weights = array();
     $signs = $query->getSigns();
     foreach ($query->getTerms() as $id => $term) {
         if ($signs === null || $signs[$id] === null || $signs[$id]) {
             $this->_weights[$id] = new Zend_Search_Lucene_Search_Weight_Term($term, $query, $reader);
             $query->setWeight($id, $this->_weights[$id]);
         }
     }
 }
Example #3
0
 /**
  * Zend_Search_Lucene_Search_Weight_MultiTerm constructor
  * query - the query that this concerns.
  * reader - index reader
  *
  * @param Zend_Search_Lucene_Search_Query $query
  * @param Zend_Search_Lucene_Interface    $reader
  */
 public function __construct(Zend_Search_Lucene_Search_Query $query, Zend_Search_Lucene_Interface $reader)
 {
     $this->_query = $query;
     $this->_reader = $reader;
     $this->_weights = array();
     $signs = $query->getSigns();
     foreach ($query->getTerms() as $id => $term) {
         if ($signs === null || $signs[$id] === null || $signs[$id]) {
             require_once sfConfig::get('sf_lib_dir') . '/modules/search/lib/Lucene/Search/Weight/Term.php';
             $this->_weights[$id] = new Zend_Search_Lucene_Search_Weight_Term($term, $query, $reader);
             $query->setWeight($id, $this->_weights[$id]);
         }
     }
 }