Hey all!

In our system users can create recurring events and search for events
starting on or after a given date. Searching and filtering of events works
perfectly, but users expect the result set to be ordered by the next start
time.

For each event, we index a multi-valued date field containing all its start
times. The relevant parts of my schema look like this:

- event_id
> - start_times_dts


In SQL I would do something like:

WHERE start_times >= %SELECTED_DATE% GROUP BY event_id HAVING
> min(start_times) ORDER BY start_times ASC


The only thing I could think of so far is to index every single start time
of an event as a separate document and group on the event. This would solve
the sorting problem but would drastically increase our index size.

Is there a more elegant way to do this in Solr? A function query or
subquery maybe? I thought about it for quite a while and couldn't come up
with a viable solution.

Cheers,

Thomas

Reply via email to