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.
Does anyone see any another solution to this?