Searching date and time in Lucene query string in Cloudant -
i trying write index , search using date , time in index in cloudant nosql database. when pass date in query string, works fine
created_date:[2015-08-16 2015-08-27]
this returns correct results when include time in parameter:
created_date:[2015-08-16 07:38:00 2015-08-27 07:38:02]
i error:
cannot parse 'created_date:[2015-08-16 07:38:00 2015-08-27 07:38:02]': encountered " "to" "to "" @ line 1, column 50. expecting 1 of: "]" ... "}"
i have more query parameters before above gist of error.
this apache lucene query string. causing happen?
according lucene java doc, date format should looks this:
a date field shall of form 1995-12-31t23:59:59z trailing "z" designates utc time , mandatory
this format derived standards compliant (iso 8601) , more restricted form of canonical representation of datetime xml schema part 2. examples...
1995-12-31t23:59:59z 1995-12-31t23:59:59.9z 1995-12-31t23:59:59.99z 1995-12-31t23:59:59.999z
so, miss 't' between date , time.
for more information: https://lucene.apache.org/solr/4_10_4/solr-core/org/apache/solr/schema/datefield.html
Comments
Post a Comment