CodeExplorer buildTermQuery example
$definition =
new ElasticsearchProductDefinition( $this->
createMock(ProductDefinition::
class),
$this->
createMock(Connection::
class),
[],
new EventDispatcher(),
$searchQueryBuilder,
$this->
createMock(EsProductDefinition::
class) );
$criteria =
new Criteria();
$criteria->
setTerm('test'
);
$query =
$definition->
buildTermQuery(Context::
createDefaultContext(),
$criteria);
$queries =
$query->
toArray();
static::
assertEquals([ 'match' =>
[ 'name' =>
[ 'query' => 'test',
],
],
],
$queries);
}