Question

My SOLR is used to store events.
Events can repeat.
I need to filter my query to fetch events in a certain date range.

Data for example:
Event A has repeats in the following dates 1st, 10th, 15th, 29th
Event B has repeats in the following dates 2nd, 11th, 14th, 19th
Event C has repeats in the following dates 4th and 25th.

I want all event that occur in between the 7th and 12th Result: event A and event B
Lets assume the field name is multivalued=true
Its type is

<fieldType name="tdate" class="solr.TrieDateField" sortMissingLast="true" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>

How would the url/query look like?

Was it helpful?

Solution

I'd say Lucene index is really not the tool to use for this kind of task, but if there is some reason you must use it, I'd suggest making a distinct document for every pair (event, date) instead of multivalued fields. Then you won't have a problem formulating a query.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top