Hi Vikas,
In addition to the remarks from David, sorting will be faster if it is backed by a range index. That would mean that you need the date to be available in xs:date format in either the element you are sorting on, or perhaps on an attribute of that element. You could add such attribute during ingestion.. Kind regards, Geert *Van:* [email protected] [mailto: [email protected]] *Namens *David Ennis *Verzonden:* donderdag 6 februari 2014 13:21 *Aan:* [email protected] *Onderwerp:* Re: [MarkLogic Dev General] date sorting for dd-mm-yyyy HI. Is there some way that you could possibly transform your input data. The issue you are seeing is not specifically about MarkLogic. The XML Schema itself defines date and dateTimes as: http://en.wikipedia.org/wiki/ISO_8601 Overall, things may be easier if your XML were already storing your dates in your XML in a way that the functions in the xs namespace are expecting. Kind Regards, David On 06/02/14 12:25, [email protected] wrote: Hi I want to sort my content using sort operator for newsdate element, but my date format is dd-mm-yyyy. But Marklogic date comparison works on yyyy-mm-dd sort : dateAscending <operator name="sort"> <state name="dateAscending"> <sort-order direction="ascending" type="xs:date" <element ns="" name="newsdate" /> </sort-order> </state> </operator> Getting 500 internal server error XDMP-CAST: (err:FORG0001) xs:date(($result/descendant::newsdate)[1]) -- Invalid cast: "03-12-2013" cast as xs:date Thanks, Vikas Singh This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general -- *David Ennis* *Content Engineer* [image: Afbeelding verwijderd door afzender. HintTech Mastering the value of content] <http://www.hinttech.com> Mastering the value of content creative | technology | content Delftechpark 37i 2628 XJ Delft The Netherlands T: +31 88 268 25 00 M: +31 6 000 000 00 [image: Afbeelding verwijderd door afzender. Website]<http://www.hinttech.com> [image: Afbeelding verwijderd door afzender. Twitter]<https://twitter.com/HintTech> [image: Afbeelding verwijderd door afzender. Facebook]<http://www.facebook.com/HintTech> [image: Afbeelding verwijderd door afzender. LinkedIn]<http://www.linkedin.com/company/HintTech> [image: Afbeelding verwijderd door afzender. HintTech Mastering the value of content] <http://www.dayon.nl>
<<image001.jpg>>
<<image002.jpg>>
<<image003.jpg>>
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
