Filtering in Calendar Category with Low Search
Hi, I am working through the list of filters we need as search parameters for searching Events in Solspace Calendar. Using your Low Search Calendar in conjunction with Low Search.
I would like to filter events by calendar type which I've set up as a category group. And the relationship here is a bit complicated since it is not a simple relationship field because of Solspace Calendar.
I am using calendar:method="occurrences" for the search results.
Looking through your documentation, I didn't seem to find anything that would produce the results that I need. Is there a way to do this?
Thanks.
Replies
Low 17 Jul 2015 08:30
I assume you're determining calendar type by category, and you're assigning these categories to events.
If that's the case, you should be able to just use the categories filter.
Yujin 17 Jul 2015 12:23
The calendar types are only assigned to the calendars. The events for any particular calendar have different category groups that they are assigned to.
Yujin 17 Jul 2015 16:23
To clarify, each calendar is associated with an organization - so the calendar type category is essentially an organization type (e.g., community, academic, cultural, etc...).
The event category groups pertain to location (Manhattan, Brooklyn, etc..), topic (art & architecture, dance, cultural studies, etc...) and event type (workshop, lecture, exhibition, etc...).
I would like to filter events by calendar/organization type - so for instance, see events from all academic organizations. I would need to find events associated with calendars that have the "academic" category.
Low 18 Jul 2015 09:04
That isn't possible out of the box, I'm afraid.
An extension, using the low_search_pre_search hook, would be needed to read the given category, query the calendar IDs for the associated calendar entries, and set the calendar_id parameter accordingly.
However, I just saw that the Occurrences tag doesn't have a calendar_id parameter (or at least there's no mention of it in the docs), which means the above solution would only work with the "cal" or "events" methods. I'd contact Solspace to ask if that is indeed the case.
If the Occurrences method does support the calendar_id parameter (or you're OK with using the Events or Cal methods), then I could create that extension for you, for a fee. If you're interested in that, feel free to contact me.