I have this piece of code here below:
$fq.=" + (fritidsboende_uth_from:[$fritids_uth_from TO *]
AND fritidsboende_uth_t开发者_JAVA百科o:[* TO $fritids_uth_to])
OR (fritidsboende_uth_from:'1972-01-01T01:01:00Z'
AND fritidsboende_uth_to:'2019-01-01T01:01:00Z')";
I have noticed my app doesn't get anything behind the colon, in this part of the code:
OR (fritidsboende_uth_from:'1972-01-01T01:01:00Z' // Notice the colon in the date string
I get this error msg: Unrecognized date string: '1972-01-01T01'. Nothing from behind the colon is there though.
How should I 'escape' it so that the colon is properly recognized?
Its PHP...
Thanks
UPDATE:
I have this querystring, so maybe the colon is lost in this translation...hmm...
+%28fritidsboende_uth_from%3A%5B2010-04-09T01%3A01%3A00Z+TO+%2A%5D+AND+fritidsboende_uth_to%3A%5B%2A+TO+2010-04-10T01%3A01%3A00Z%5D%29+OR+%28fritidsboende_uth_from%3A1972-01-01T01%3A01%3A00Z+AND+fritidsboende_uth_to%3A2019-01-01T01%3A
EDIT based on SOLR comment by OP
try adding braces and complete the ranges, like:
$fq.=" + (fritidsboende_uth_from:[$fritids_uth_from TO *]
AND fritidsboende_uth_to:[* TO $fritids_uth_to])
OR (fritidsboende_uth_from:[1972-01-01T01:01:00Z TO *]
AND fritidsboende_uth_to:[* TO 2019-01-01T01:01:00Z])";
see: Solr fetching date ranges
精彩评论