simple match query with Elastica QueryBuilder simple match query with Elastica QueryBuilder elasticsearch elasticsearch

simple match query with Elastica QueryBuilder


Probably not the more convienient way of doing it but it works (you surely found a way to do it anyway) :

$price = new \Elastica\Query\Match();$price->setField("price","2");$product = new \Elastica\Query\Match();$product->setField("_index","product");$boolQuery = new \Elastica\Query\BoolQuery();$boolQuery->addMust([$price, $product]);$query = new \Elastica\Query($boolQuery);