I’m new to solr, so I might be missing something very obvious. It seems like my datetime queries don’t get parsed correctly. For example, a query like this:
solr/select?q=last_updated:1995-12-31T23:59:59Z
results in the following:
org.apache.solr.common.SolrException: Invalid Date String:'1995-12-31T23'
at org.apache.solr.schema.DateField.parseMath(DateField.java:161)
at org.apache.solr.schema.DateField.toInternal(DateField.java:131)
at org.apache.solr.schema.FieldType.getFieldQuery(FieldType.java:580)
at org.apache.solr.search.SolrQueryParser.getFieldQuery(SolrQueryParser.java:201)
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1429)
It seems like solr separates the query by colons and the rest of the date gets lost. I tried to
play around with date formatting and that’s exactly the behavior I observe.
You need to put the date in double quotes.
For eg. last_updated:”1995-12-31T23:59:59Z” .
Otherwise, this date string gets tokenized/analyzed.