Mmanos\Search\Query::search PHP Method

    public function search($field, $value, array $options = array())
    {
        $this->query = $this->index->addConditionToQuery($this->query, array('field' => $field, 'value' => $value, 'required' => array_get($options, 'required', true), 'prohibited' => array_get($options, 'prohibited', false), 'phrase' => array_get($options, 'phrase', false), 'fuzzy' => array_get($options, 'fuzzy', null)));
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * Initialize and return a new Query instance on this index
  * with the requested search condition.
  *
  * @param string $field
  * @param mixed  $value
  * @param array  $options - required   : requires a match (default)
  *                        - prohibited : requires a non-match
  *                        - phrase     : match the $value as a phrase
  * 
  * @return \Mmanos\Search\Query
  */
 public function search($field, $value, array $options = array())
 {
     $query = new Query($this);
     return $query->search($field, $value, $options);
 }