You aggregation is pretty hard to read, so I may be wrong.
as you can see in the hits.total field, there are still 280k documents that need to be filtered for.
Can you create an additional filter terms query in the query to only filter for the ids that you are interested in? This would reduce the total number of documents, that you have to aggregate against and likely give you a speedup.
At existing approach, i put ids in filters field and then aggregate result through field supplier_nom.id. Then i have much more ids, i lose speed. Is there any way to reconstruct query in order to gain speed with the same logic?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.