We found out that a plain SolrCloud will return random sorted docs if you define a custom sort field or function. This problem is also mentioned here and is not really fixed.
You can do the following steps to reproduce this issue: here.
In the meantime we're also investing on this issue and try to debug the QueryComponent. But if there is any hint or thought available, we're very happy to hear from you. Maybe Christine Poerschke can help here a little bit?
What we've found out so far:
- It only happens in SolrCloud mode (shards > 1)
- Maybe is has something to do with the MergeStrategy in the QueryComponent.
You can also use the pull request to reproduce the problem.