: like to understand how the ordering is defined so that I can compute an : integer that is sorted in the same way. For example (shard "id" << 24) | : docid or something like that.
If you want to ensure a consistent ordering, you have to index a (unique) value that you use as a secondary sort -- you can't trust the internal docids will remain unchanged. -Hoss