Hello!
My search page needs to have a custom sorting type.
To do this sorting i need to return about 5k items from elasticsearch
The problem is that this causes a serious performance problem, the application ends up crashing all the time.
I need the 5k items to go through each one and decide how to display in the listing
If I use the "size" parameter with the value "30" for example, I can't use my custom rule
Is there any way to not have this performance problem?
for every page with 30 products, i need to show a certain percentage of products from specific stores
example:
page 1 - 30 products (10 products from store 1, 10 products from store 2, 10 products from store 3)
page 2 - 30 products (10 products from store 1, 10 products from store 2, 10 products from store 3)
page 3 - 30 products (10 products from store 1, 10 products from store 2, 10 products from store 3)
and so on
I have a business rule in ruby that does this sorting
but it doesn't work if the size parameter is equal to "30"
because I need to run the sort on top of all products returned by elasticsearch
but when I set the "size" to 5k for example, the performance is terrible
How are you sorting the results related to a single store?
If this is simpler, might an option perhaps be to run three queries in parallel (one per store) using the multi search API and let Elasticsearch sort the queries and then let your application merge them?
If you still need to return 5k results you may need to look into adding resources to your cluster.
It might also help if you show the query that is slow, which version of Elasticsearch you are using and what the specification of your cluster is.
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.