marklogic/Corona — Issue #65: Unable to search on dateTime range index
Author: stoussaint
Created: 2011-12-06 15:34:40+00:00
State: open

I'm just giving a try to Corona and gone to the search rest API.
I'm able to do a lot of thing but unable to query a dateTime index with something like :

http://localhost:8004/search?outputFormat=xml&structuredQuery=date-submitted2011-11-22T17:30:002011-11-22T17:35:00

* The manage/ranges return : [{"":"date-submitted","":"dc:dateSubmitted","":"dateTime"}]
* The manage/namespaces return : [{"":"dc","":"http://purl.org/dc/elements/1.1/"}]
* I have an element range index set in marklogic for {http://purl.org/dc/elements/1.1/}dateSubmitted with dateTime type

The result is an error : No string element range index for xs:QName("dc:dateSubmitted") http://marklogic.com/collation/ which I could understand because indeed I have no string range index for this element/

The underlying cts query is :
```cts:search(fn:doc(), cts:and-query((
cts:element-range-query(xs:QName("dc:dateSubmitted"), ">=", "2011-11-22T17:30:00", ("collation=http://marklogic.com/collation/"), 1),
cts:element-range-query(xs:QName("dc:dateSubmitted"), "<=", "2011-11-22T17:35:00", ("collation=http://marklogic.com/collation/"), 1)),
()), "unfiltered")```

While I'm waiting something like
```cts:search(fn:doc(), cts:and-query((
cts:element-range-query(xs:QName("dc:dateSubmitted"), ">=", xs:dateTime("2011-11-22T17:30:00")),
cts:element-range-query(xs:QName("dc:dateSubmitted"), "<=", xs:dateTime("2011-11-22T17:35:00"))),
()), "unfiltered")```

What am I doing wrong ?