Aggregation filters in combination

33 views
Skip to first unread message

Nikolay Nikolov

unread,
Mar 3, 2016, 7:41:43 AM3/3/16
to Elastica - Elasticsearch PHP Client
Hi, I am trying to combine the filters for a FilterAggregation. Here the example:

$agg = new Elastica\Aggregation\Filters('size');


$filter1 = new Elastica\Query\Terms();       

$filter1->setTerms('color', $color);


$filter2 = new Elastica\Query\Terms();

$filter2->setTerms('material', $material);


$agg->addFilter($filter1);

$agg->addFilter($filter2);


The Problem here, ElasticSearch don't combine the filter and give me an array with 2 elements, where each filter is aggregated but not the aggregation from both filter with AND.

How to make the AND between the filter?


Thanks

Nik

ruflin

unread,
Mar 3, 2016, 8:26:31 AM3/3/16
to Elastica - Elasticsearch PHP Client
Reply all
Reply to author
Forward
0 new messages