How to query ElasticSearch?

Good day to all. The issue relates to faceted search.

Let's say there are 2 filters:

2.1 Categories
Cargo (1765)
Passenger (1566)
Any other (8675)

2.2 Color
Red (5689)
Green (156)
Blue (3599)
Yellow (2562)

As we can see in front of each filter is indicated how many elements are individually stored in the elastic.
Check the box next to "cargo".

The behavior now:

2.1 Categories
Cargo (1765)
Cars (0)
Any other (0)

2.2 Color
Red (amount of red trucks)
Green (amount of green cargo)
Blue (no blue trucks)
Yellow (number yellow freight)

Need this behavior:

2.1 Categories
Cargo (1765)
Passenger (1566)
Any other (8675)

2.2 Color
Red (amount of red trucks)
Green (amount of green cargo)
Blue (no blue trucks)
Yellow (number yellow freight)

That is to filter on a specific field does not affect the aggregation, but affects all the rest. How is it possible to implement optimized? Now implemented for x queries to the elastic and x is the count of filters
March 19th 20 at 08:50
0 answer

Find more questions by tags Elasticsearch