Hi Stephane,
Thanks for your reply. To demonstrate why it would be good to have @le,
perhaps it will help to show the hack I currently have to use in order
to get all dates up to and including a "to" date:
let $to := "1800-01-01"
(: Hack: Add one day as ML doesn't understand le. :)
let $next := $to cast as xs:date + xs:dayTimeDuration("P1D")
return <constraint name="Dates-To">
<range type="xs:date" facet="false">
<bucket lt="{$next}" name="{$to}">Dates to {$to}</bucket>
<element ns="http://example.com/" name="date"/>
<attribute ns="" name="to"/>
</range>
</constraint>
Best,
Tim Finney
On Thu, 2012-04-05 at 08:59 -0700, Stephane Toussaint wrote:
> Hi,
>
> "lt" and "ge" are not to be considered as operators. They are
> attributes used to describe a range of values in order to put them all
> in one simple bucket range.
> Can't see a case where we need something different. Maybe you have a
> simple example.
>
> Best Regards,
> Stephane
>
>
>
> Le 28 mars 2012 ? 21:55, Tim Finney a ?crit :
>
> > Hi All,
> >
> > In search:search, a bucketed range constraint allows intervals to be
> > specified using @ge and @lt. E.g.
> >
> > <constraint name="decade">
> > <range type="xs:gYear" facet="true">
> > <bucket lt="1920" name="earlier">earlier</bucket>
> > <bucket ge="1920" lt="1930" name="1920s">1920s</bucket>
> > <bucket ge="1930" lt="1940" name="1930s">1930s</bucket>
> > ...
> > </range>
> > </constraint>
> >
> > It is sometimes necessary to use complementary limits, as when
> filtering
> > for dates that are less than or equal to a "to" date. However,
> > specifying @le or @gt on a bucket element produces an unfiltered
> result
> > set for that bucket.
> >
> > Are there plans to add @le and @gt as bucket attributes? If not,
> should
> > I make a feature request for adding these two? (@eq might be useful,
> > too. I don't know whether or not @eq is recognised as a bucket
> > attribute.)
> >
> > Best,
> >
> > Tim Finney
> >
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general