Hi, I have a requirement to search a term within a date range. I have created a date constrain as given below and used search:search()
import module namespace search = "http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy"; let $from := "2013-10-27T09:46:35.454794-04:00" let $to := "2013-10-28T09:46:35.454794-04:00" let $options := <options xmlns="http://marklogic.com/appservices/search"> <constraint name="daterange"> <range type="xs:dateTime" facet="true"> <bucket name="daterange" ge="{$from}" lt="{$to}">Date Range</bucket> <facet-option>frequency-order</facet-option> <facet-option>descending</facet-option> <facet-option>limit=10</facet-option> <element name="datetime"/> </range> </constrain> </options> let $result := search:search("book",$options) return $result I am getting the 100 results of "book" and facet result for date range as 6 <search:facet name="daterange"> <search:facet-value name="daterange" count="6">Date Range</search:facet-value> </search:facet> Actually i want the *search results within that date range*. How to add the date range dynamically in search:search() query. Regards, Jonna
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
