Esempio n. 1
0
 protected function createFilterQuery(Query $query)
 {
     if ($this->expression === NULL) {
         return NULL;
     }
     $this->expression = $this->doInverse($this->expression);
     if (($queryString = $this->expression->build()) !== NULL) {
         $key = $this->key ?: md5($queryString);
         $fq = $query->createFilterQuery($key)->setQuery($queryString);
         if ($this->expression instanceof FieldExpression) {
             $fq->addTag($this->expression->getField());
         }
         if ($this->key !== NULL) {
             $fq->addTag($this->key);
         }
     } else {
         $fq = NULL;
     }
     $this->expression = $this->doInverse($this->expression);
     //return to original state
     return $fq;
 }