Ashley, for your element range index you created on insert_timestamp, what is the type you selected? Based on the options node you posted, it should be dateTime.
-Danny From: [email protected] [mailto:[email protected]] On Behalf Of Indrajeet Verma Sent: Wednesday, November 25, 2015 10:09 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] SEARCH-BADORDERBY As per my understanding, ML8 onwards, whatever element you use for sorting that should have range index. On Wed, Nov 25, 2015 at 11:37 PM, Indrajeet Verma <[email protected]<mailto:[email protected]>> wrote: Hey, I have faced this type of issue while upgrading to ML8 and I solved it creating range index only. Did you check collation Could you give some more details with an example? I could try to help you. Regards, Indy On Wed, Nov 25, 2015 at 11:22 PM, Ashley Peacock <[email protected]<mailto:[email protected]>> wrote: Hey, Yup I think so, I created an element range index with the namespace field left blank and the local name as insert_timestamp. Ashley Sent from my iPhone [cid:[email protected]] [cid:[email protected]] Ashley Peacock Developer II Elevate Credit International Limited P: 01284 717800 | Ext: 877 | Elevate.co.uk<http://elevate.co.uk> Amadeus House, Floral Street, Covent Garden, London WC2E 9DP Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. Elevate Credit International Limited is registered in England & Wales with Company Number 05041905. Registered Office: 27-28 Eastcastle Street, London, W1W 8DH On 25 Nov 2015, at 17:40, Indrajeet Verma <[email protected]<mailto:[email protected]>> wrote: Have you created range index on element "insert_timestamp" type of dateTime and without namespace? Regards, Indy On Wed, Nov 25, 2015 at 9:44 PM, Ashley Peacock <[email protected]<mailto:[email protected]>> wrote: Just to add to the below, I removed the index I added and re-ran the check-options and it comes up with a suggestion for an index… which is the exact index I had added. I re-added it, re-ran the check and nothing comes back suggesting I added the right index. I restarted the MarkLogic service, and even after that I still get the same response from the API as per below so somewhat stumped! Ashley <imagea4201f.PNG> [cid:[email protected]] Ashley Peacock Developer II Elevate Credit International Limited P: 01284 717800 | Ext: 877 | Elevate.co.uk<http://elevate.co.uk> Amadeus House, Floral Street, Covent Garden, London WC2E 9DP Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. Elevate Credit International Limited is registered in England & Wales with Company Number 05041905. Registered Office: 27-28 Eastcastle Street, London, W1W 8DH From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Ashley Peacock Sent: 25 November 2015 15:44 To: [email protected]<mailto:[email protected]> Subject: [MarkLogic Dev General] SEARCH-BADORDERBY Hey, I have added the following search option: <options xmlns="http://marklogic.com/appservices/search"><sort-order type="xs:dateTime" direction="descending"><element ns="" name="insert_timestamp"/><annotation>Order by the timestamp, descending</annotation></sort-order></options> If I then query using that search option, I get the following result: {"errorResponse":{"statusCode":400, "status":"Bad Request", "messageCode":"SEARCH-BADORDERBY", "message":"SEARCH-BADORDERBY: (err:FOER0000) Indexes are required to support element, element-attribute, json-property, or field sort specifications."}} I’ve added an element range index to the field it’s querying on (and it’s re-indexed), and it still throws the same error. It said in the docs I could check the index required using: search:check-options( <options xmlns="http://marklogic.com/appservices/search"><sort-order type="xs:dateTime" direction="descending"><element ns="" name="insert_timestamp"/><annotation>Order by the timestamp, descending</annotation></sort-order></options>, true() ) But that yielded no result (“your query returned an empty sequence”) which makes me think the index is correct… yet it still throws the same error. Does anyone have any ideas? Thanks, Ashley <image002.jpg> [cid:[email protected]] Ashley Peacock Developer II Elevate Credit International Limited P: 01284 717800 | Ext: 877 | Elevate.co.uk<http://elevate.co.uk> Amadeus House, Floral Street, Covent Garden, London WC2E 9DP Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. Elevate Credit International Limited is registered in England & Wales with Company Number 05041905. Registered Office: 27-28 Eastcastle Street, London, W1W 8DH Click here<https://www.mailcontrol.com/sr/7AmiNuPOlljGX2PQPOmvUmuFhuAgpUQ2de42Ozqoni8W2Wz4rmzPyDPi7XX!24hFyrF0K9sQw3yGoJj9+I0bOg==> to report this email as spam. _______________________________________________ General mailing list [email protected]<mailto:[email protected]> Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected]<mailto:[email protected]> Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected]<mailto:[email protected]> Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
