I have the following query
$queryDefinition = [ 'query' => [ 'bool' => [ 'must' => [ [ 'query_string' => [ 'default_field' => '_all', 'query' => $term ] ] ], 'must_not' => [], 'should' => [] ], ], //'filter' => [ // 'limit' => ['value' => 3], //], 'from' => 0, 'size' => 50, 'sort' => [], 'facets' => [ 'types' => [ 'terms' => ['field' => '_type'] ] ] ];
in the index we have 5 types, and I would like to show only 3 results from each type, for autocomplete. when I set a filter restriction, only the results from the first type are filtered, for other types I get all the results.
How can i do this?
thanks
source share