예제 #1
0
 /**
  * Add a query term
  * 
  * @param string $id		identifier for this query term
  * @param string $boolean	boolean operator combining this phrase to the total query
  * @param string $field		field to search on
  * @param string $relation	operator
  * @param string $phrase	search term value
  */
 public function addTerm($id, $boolean, $field, $relation, $phrase)
 {
     if ($field == "") {
         $field = "keyword";
     }
     // alter query based on config
     $field_internal = "";
     if ($this->config != null) {
         $field_internal = $this->config->swapForInternalField($field);
         $phrase = $this->alterQuery($phrase, $field);
     }
     $term = new QueryTerm($id, $boolean, $field, $field_internal, $relation, $phrase);
     array_push($this->terms, $term);
 }