Hi David, Thanks, I think we'll take the pre-processing or date cleanup approach.
Regards, Danny On Sun, Oct 12, 2014 at 3:42 PM, Dave Cassel <[email protected]> wrote: > For completeness, you could also solve this at run time with a User > Defined Function > <http://docs.marklogic.com/guide/search-dev/aggregate#chapter>, but > you'll find pre-processing much easier. If you decide to go the UDF route, > here's a post with an example > <http://blog.davidcassel.net/2012/09/a-mapreduce-aggregation-function-in-marklogic-6/> > (dated, > but still accurate as far as I know). > > -- > Dave Cassel > Developer Community Manager > MarkLogic Corporation <http://www.marklogic.com/> > Cell: +1-484-798-8720 > > > From: David Ennis <[email protected]> > Reply-To: MarkLogic Developer Discussion <[email protected]> > Date: Friday, October 10, 2014 at 9:13 AM > To: MarkLogic Developer Discussion <[email protected]> > Subject: Re: [MarkLogic Dev General] cts:element-range-query for months > in a date > > I would suggest that you pre-process your documents to include an > attribute of the xs:gMonth datatype (just the month digits) and add a range > index on this. > > The the query is absolutely specific: *cts:element-attribute-query([your > attribute], ">", 10)* > > > > Kind Regards, > David Ennis > > > David Ennis > *Content Engineer* > > [image: HintTech] <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 63 091 72 80 > > [image: http://www.hinttech.com] <http://www.hinttech.com> > <https://twitter.com/HintTech> <http://www.facebook.com/HintTech> > <http://www.linkedin.com/company/HintTech> > > On 10 October 2014 18:08, Danny Sinang <[email protected]> wrote: > >> We have a "publicationDate" element in the form "YYYY-MM-DD". >> >> How do I issue a cts:element-range-query against it to list all >> documents whose publicationDate month is greater than 10 ? >> >> >> >> Regards, >> Danny >> >> >> >> >> >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> >> > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > >
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
