0

Issue is how to index this data properly so that querying can be possible as well.

I need to get the data of events on the basis of date, day of week and time slot. My primary id is event id.

  • Table1-
    select event_id, from_date, to_date from event_listing. event_id is primary key.
    
  • Table2
    select dayOfWeek, slot_start_time, slot_end_time from slot_data where event_id = $eventId
    

I need to index these data in solr, like - I'll get only one record for one particular event.

Once data is indexed, I need to query this data on the basis of- time slots and dayOfweek.

Let me know the suitable way to get this.

cursorrux
  • 1,382
  • 4
  • 9
  • 20
  • 1
    One way to achieve this would be to index each event/date/start_time/end_time as as individual Solr documents. You can then query by either event_id, by date/time range as you please. The data will not come grouped as a single document, but you can then use facets or other Solr filtering options to group the data (or group it in your app.) Keep in mind that Solr is not a relational database and you might be better off not trying to mimic your relational database in Solr and use a different data model. – Hector Correa Sep 03 '21 at 13:34
  • A date range field should be able to let you query events by timeslot; i.e. you index a multivalued field with a daterange that notes every interval that the event is active in. Wouldn't that work? – MatsLindh Sep 03 '21 at 19:08
  • @HectorCorrea got it, can you answer my query regarding to solr https://stackoverflow.com/questions/69073742/solr-date-range-issue – Anshul Verma Sep 07 '21 at 07:46

0 Answers0