I'm using Apache Solr 4.7.2.
I need to implement the following behavior: user provides a list of IDs and Solr returns documents paginated and ordered by the same order the user informed the IDs.
I came across the boost terms approach. So if user provides the IDs "2875141 2873071 2875198 108142 2918841 2870688 107920 2870637 2870636 2870635 2918792 107721 2875078 2875166 2875151 2918829 2918808", my Solr query will be:
studentId:(2875141^16 2873071^15 2875198^14 108142^13 2918841^12 2870688^11 107920^10 2870637^9 2870636^8 2870635^7 2918792^6 107721^5 2875078^4 2875166^3 2875151^2 2918829^2 2918808^1)
But this approach is not always working. For this example specifically, we can see at this explain query, that the highest score isn't for the ^16
.
If I use big boost values such as 1, 10, 100, 1000, 10000 and so on, adding one 0 at the end, as suggested in this cookbook, the ordering works fine. But that will be an issue if user searches for 200 items for instance, the query will be too long causing communication issues.
Is there any other approach I could achieve this? If not, could I use like multiplication or exponencial operations in order to get big boost factors with less characters?
Thanks