Answer the question
In order to leave comments, you need to log in
How to create a request to ElasticSearch?
Good day everyone. The question is about facet search.
Let's say there are 2 filters:
2.1 Categories
Trucks (1765)
Cars (1566)
Any other (8675)
2.2 Colors
Red (5689)
Green (156)
Blue (3599)
Yellow (2562)
As we can see opposite each filter indicates how many elements individually stored in elastic.
Put a tick in front of "cargo".
Behavior now:
2.1 Categories
Trucks (1765)
Cars (0)
Anything else (0)
2.2 Colors
Red (number of red trucks)
Green (number of green trucks)
Blue (number of blue trucks)
Yellow (number of yellow trucks)
Need this behavior:
2.1 Categories
Trucks (1765)
Cars (1566)
Anything else (8675)
2.2 Colors Red (
number
of red trucks)
-number of green trucks)
Blue (number of blue trucks)
Yellow (number of yellow trucks)
That is, so that the filter on a particular field does not affect its aggregation, but affects all the others. How can this be done in an optimized way? Now it is implemented for x requests to elastic, and x is equal to the number of filters
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question