hi Ashley, I had faced a similar issue, the option was mentioned as <sort-order type="xs:dateTime" collation="http://marklogic.com/collation/" direction="descending"> instead of <sort-order type="xs:dateTime" collation= direction="descending">, due to which Marklogic was expecting a string index.
Thanks Mahitha On Wed, Nov 25, 2015 at 9:44 AM, Ashley Peacock <[email protected]> wrote: > 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 > > > > *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 > > > > > _______________________________________________ > General mailing list > [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
