The key was in the Indexing
value for the field, it must be set to Default
in order for the range field to be set up correctly for integer sorting.
Cannot sort integer field index correctly in RavenDB
Pergunta
I can't seem to get an integer field to sort correctly.
I have the field defined with a Sort of int:
When I query it in the management studio by this field descending, the results sort correctly:
However, my understanding is when using OrderByDescending
using LINQ in .NET, it will use the MaximumReach_Range
field, which I've confirmed in Fiddler:
But when I sort by that in the Management Studio or call OrderByDescending
using LINQ in .NET, the order is wrong:
I'm fairly sure that it's an issue with how the field is set up in the index, but I'm not sure which aspect outside of the Sort
value needs to be changed.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow