Mmanos\Search\Query::where PHP Method

where() public method

Add a basic where clause to the query. A where clause filter attemtps to match the value you specify as an entire "phrase". It does not guarantee an exact match of the entire field value.
public where ( string $field, mixed $value ) : Query
$field string
$value mixed
return Query
    public function where($field, $value)
    {
        $this->query = $this->index->addConditionToQuery($this->query, array('field' => $field, 'value' => $value, 'required' => true, 'filter' => true));
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Initialize and return a new Query instance on this index
  * with the requested where condition.
  *
  * @param string $field
  * @param mixed  $value
  * 
  * @return \Mmanos\Search\Query
  */
 public function where($field, $value)
 {
     $query = new Query($this);
     return $query->where($field, $value);
 }