I have a document like this:
<doc>
<arr name="StartDate">
<date>2012-08-18T17:00:00Z</date>
<date>2012-06-28T17:00:00Z</date>
<date>2013-02-28T17:00:00Z</date>
<date>2012-04-16T17:00:00Z</date>
<date>2012-08-06T17:00:00Z</date>
<date>2012-05-18T17:00:00Z</date>
<date>2012-07-04T17:00:00Z</date>
</arr>
<arr name="EndDate">
<date>2012-09-29T17:00:00Z</date>
<date>2012-06-29T17:00:00Z</date>
<date>2013-04-16T17:00:00Z</date>
<date>2012-05-07T17:00:00Z</date>
<date>2012-08-15T17:00:00Z</date>
<date>2012-06-22T17:00:00Z</date>
<date>2012-08-01T17:00:00Z</date>
</arr>
</doc>
I have a date range and want to find a pair of StartDate and EndDate that span the range. For example, the first pair of startDate and EndDate (2012-08-18 TO 2012-09-29) returns true if the input range (x, y) is 2012-08-18 <x and 2012-09-29> y.
I wrote this query:
StartDate: [1995-12-31T23: 59: 59.999Z TO 2012-08-18T00: 00: 00.000Z] AND EndDate: [2012-09-29T00: 00: 00.000Z K 2099-01-01T00 : 00: 00.000Z]
but the problem is finding the SOLR of all matches in the set of 14 items above, while I just want to compare them one at a time (1 with 1, 2 with 2 ...).
Please tell me how to do this. Many thanks.
source
share