Smile\ElasticsuiteCore\Search\Request\Query\Term::__construct PHP Метод

__construct() публичный Метод

The term query produce an Elasticsearch term query.
public __construct ( string $value, string $field, string $name = null, integer $boost = QueryInterface::DEFAULT_BOOST_VALUE )
$value string Search value.
$field string Search field.
$name string Name of the query.
$boost integer Query boost.
    public function __construct($value, $field, $name = null, $boost = QueryInterface::DEFAULT_BOOST_VALUE)
    {
        $this->name = $name;
        $this->value = $value;
        $this->field = $field;
        $this->boost = $boost;
    }

Usage Example

Пример #1
0
 /**
  * The term query produce an Elasticsearch terms query.
  *
  * @param string|array $values Search values. String are exploded using the comma as separator.
  * @param string       $field  Search field.
  * @param string       $name   Name of the query.
  * @param integer      $boost  Query boost.
  */
 public function __construct($values, $field, $name = null, $boost = QueryInterface::DEFAULT_BOOST_VALUE)
 {
     if (!is_array($values)) {
         $values = explode(',', $values);
     }
     parent::__construct($values, $field, $name, $boost);
 }