satish kumar V
satish kumar V

Reputation: 1755

DocumentDb order By returning an error

I am using documentDB for my database storage, and today I tried to write a query with order by clause, and the query is something like this

select * from root r where r.gender = 'Male'  ORDER BY r.age

it is returning an error,

{"Message: {\"Errors\":[\"Order-by index path has a precision that might result in partially ordered results. To proceed with query execution, specify the enable low precision order by option in the request.\"]}\r\nActivityId: 73dc7fda-659e-4580-b000-2ca5124a44e6, Request URI: /apps/64ca7410-c445-4884-a8bb-32f6a60a6ca2/services/3dd6c9e7-3138-4968-b8e6-be51b4d9748e/partitions/30c57c8f-3494-419b-9f45-ec50582bffd9/replicas/130802821685931221p"}

However, the query without order by clause is executing fine and resulting correctly,

anything wrong with my query?

Any help would be greatly appreciable.

Thanks in advance.

Upvotes: 1

Views: 632

Answers (2)

Kirat P.
Kirat P.

Reputation: 76

To add to the above answer, re-indexing collections while online is now possible

http://azure.microsoft.com/en-us/blog/update-your-documentdb-indexing-policies-online/

Upvotes: 2

Aravind Krishna R.
Aravind Krishna R.

Reputation: 8003

You should modify your indexing policy to use Maximum precision (-1) in order to execute Order By. Please refer to https://azure.microsoft.com/en-us/documentation/articles/documentdb-orderby/#configure-an-indexing-policy-for-order-by

Upvotes: 2

Related Questions