/**
  * Accepts a string a query and returns the set of documents relevant 
  * to the query
  * @param string $queryStr
  * @return array 
  */
 public function query($queryStr)
 {
     $queryObj = QueryAbstractFactory::factory($queryStr);
     if ($queryObj instanceof SingleTermQuery && isset($this->index[$queryObj->getQuery()])) {
         return $this->index[$queryObj->getQuery()][self::POSTINGS];
     } else {
         if ($queryObj instanceof MultiTermQuery) {
             return $this->getMultiTermResults($queryObj->getQuery());
         }
     }
     //no results available
     return array();
 }
Esempio n. 2
0
 /**
  * Accepts a string a query and returns the set of documents relevant 
  * to the query
  * @param string $queryStr
  * @return array 
  */
 public function query($queryStr)
 {
     return QueryAbstractFactory::factory($queryStr)->queryIndex($this);
 }