Hi, Shiv:
The "options" key should be in the object contained by the "search" key, not in
the object
contained by the "$query" key.
To put it another way, the "options" key should be a peer to the "$query" key,
not a child.
The basic structure:
{"search":{
"$query": {...},
"options": {...}
}
}
Also, the key should be $filtered instead of $filter
By the way, if you are supplying options, you can enable filtered search within
the options:
http://docs.marklogic.com/guide/search-dev/appendixa#id_77801
If you moved the filtering into the options, given that you aren't supplying an
actual query,
an alternative would be to use the /v1/search endpoint.
Hoping that helps,
Erik Hennum
________________________________
From: [email protected]
[[email protected]] on behalf of Shiv Shankar
[[email protected]]
Sent: Wednesday, January 11, 2017 10:26 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] sort-order is not working as expected
Hi,
I am using sort-order option in "search" query, but the results are not in
order as expected i.e it is same order for Ascending/descending. I created an
range-index too.
Any advise?
Query:
http://localhost:8080/LATEST/qbe?query={"search":{"$query":{"$filter":true,"options":{"sort-order":[{"direction":"ascending","element":"age"}]}}}}&collection=TEST-COLL
Thanks
Shan.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general