elasticsearch - Applying custom filters for aggregation in Elastic Search -
i have more 2 million documents has price , discount. have percentage of products 10%, 20%, 30%,......, 90%, 100% discount(discounts rounded off). not possible fetch data , aggregate on application layer @ take time. afraid create lag other users thread busy long time.
is there way can create custom filters upon aggregation logic?
it doesn't need custom filter here. functionality standard part of histogram aggregation. can take @ range aggregation in case need more flexible ranges.
if need complete flexibility in how terms calculated can use script in terms aggregation return value want group records by. however, 2 million documents, might better pre-calculate discount during before indexing document, store value separate field , use histogram aggregation.
Comments
Post a Comment