Not unless you can somehow codify that sort order at index time, but I'm assuming the sort order changes dynamically.
You can also sort by function, but that's not really useful. Or, if these are relatively short lists, you can sort at the app layer. Best, Erick On Thu, Mar 12, 2015 at 2:16 AM, Johannes Siegert <johannes.sieg...@marktjagd.de> wrote: > Hi, > > i want to sort my documents by a given order. The order is defined by a list > of ids. > > My current solution is: > > list of ids: 15, 5, 1, 10, 3 > > query: q=*:*&fq=(id:((15) OR (5) OR (1) OR (10) OR > (3)))&sort=query($idqsort) desc,id asc&idqsort=id:((15^5) OR (5^4) OR (1^3) > OR (10^2) OR (3^1))&start=0&rows=5 > > Do you know an other solution to sort by a list of ids? > > Thanks! > > Johannes