By default it will sort on a String basis. If you want to customize the behaviour, you have to write the index.
... which doesn't take much time
public class Cup_ByOrder : AbstractIndexCreationTask<Cup>
{
public Cup_ByOrder()
{
Map = cups => from cup in cups
select new
{
cup.Order
}
Sort(x=>x.Order, SortOptions.Int);
}
}
In your application load, add the index through:
// Assuming ASP.NET
public class Global
{
public static IDocumentStore Store;
public void Application_Start(object sender, EventArgs e)
{
Store = new DocumentStore { ... }.Initialize();
Indexes.CreateIndexes(typeof(Cup_ByOrder).Assembly, Store);
}
}
And now it works as you expect.