Beispiel #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;
 }
Beispiel #2
0
 /**
  * @return string
  */
 public function build()
 {
     return sprintf('%s:(%s)', $this->field, $this->expression->build());
 }
Beispiel #3
0
 /**
  * @return string
  */
 public function build()
 {
     return 'NOT(' . $this->expression->build() . ')';
 }
Beispiel #4
0
 public function match(Query $query)
 {
     if ($this->expression && ($queryString = $this->expression->build()) !== NULL) {
         $query->setQuery($queryString);
     }
 }