I have a problem that I haven't been able to solve that someone might have a better solution to.
I have an index with a couple of 100000 documents. Depending on attributes like country, language etc. I want the sorting to be different. I have precalculated these sorting tables in Hadoop and there are currently about 100000 different combinations of values, so I can't store them as fields in the documents.
I have tried these solutions already, they all work, but are to slow basically:
Fetching the sorting tables from Hadoop, setting it as a hashed array in the parameters to MVEL, and using scripting to sort them.
Doing the same, but sending it as an normal array and using indexof instead to sort.
Saving all the different combinations comma-separated in a field and using MVEL to split and sort.
I also tried to separate all the attributes and giving them a score value and calculate the sorting order that way, but the result is not exact enough for our needs.
I might not understand your problem well enough, but if you try to
sort the documents directly form Elasticsearch, it takes too long?
In my experience, it can sort query results really quickly.
If I get your problem wrong, can you explain more about what you're
after? Are you trying to do a query that will return all indexed
documents, sorted by a specific field?
I have a problem that I haven't been able to solve that someone might have a
better solution to.
I have an index with a couple of 100000 documents. Depending on attributes
like country, language etc. I want the sorting to be different. I have
precalculated these sorting tables in Hadoop and there are currently about
100000 different combinations of values, so I can't store them as fields in
the documents.
I have tried these solutions already, they all work, but are to slow
basically:
Fetching the sorting tables from Hadoop, setting it as a hashed array in
the parameters to MVEL, and using scripting to sort them.
Doing the same, but sending it as an normal array and using indexof
instead to sort.
Saving all the different combinations comma-separated in a field and
using MVEL to split and sort.
I also tried to separate all the attributes and giving them a score value
and calculate the sorting order that way, but the result is not exact enough
for our needs.
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.