Let’s imagine we have the simplest Map index:
Map = posts => from post in posts
orderby post.DateTime
select new { Id = post.Id, DateTime = post.DateTime }
How does OrderBy clause will influence on Map index results? Does it define a default documents ordering in the case if your query doesn’t provide order clause explicitly? How are documents sorted in the case no ordering clause was provided neither in index nor in query?
This orderby will be ignored at all – it has no effect on how the index will be executed.
By default (if you don’t specify a specific ordering) you will have lexicographic order.
You can either sepecify an order on the index itself (see here: http://ravendb.net/docs/client-api/querying/static-indexes/customizing-results-order) or at query time.