- Issue created by @mpotter
- 🇺🇸United States mpotter
It appears that the SearchApiAlgoliaBackend::extractConditions function does not support `IN` queries. Would be good to document this as it prevents many common Views filters such as Content Type from working.
- Status changed to Needs review
over 1 year ago 10:08pm 6 April 2023 - 🇺🇸United States mpotter
Added a patch that will at least support the "IN" operator when only one option is selected. This allows a basic Content Type filter to work when you just need a single content type since Drupal Views doesn't have an option for '=' operator on that field.
- 🇺🇸United States mpotter
Updated patch to get the value rather than key of array.
However, while this patch works for Content Type, I'm not able to get it working for Taxonomy fields. I have a `field_topic` and with this patch it properly passes a filter of `field_topic:123` and in Algolia I have a node with a value of 123 for field_topic but the result isn't returned. I just get no results at all. So something is still not quite right with taxonomy filters.
- 🇺🇸United States mpotter
Found the bug problem with taxonomy terms. The existing code had a bug when adding the "AND" clause to the filter query. I think I can also see how to chain multiple terms using the AND operator, so will post another update for that soon.
- 🇺🇸United States mpotter
OK, I've updated the patch to work with any number of items with the IN operator. I think this is ready for review now.
- 🇮🇳India nikunjkotecha India, Gujarat, Rajkot
Can we please have full steps to reproduce so we can review the patch and confirm the fix?
Details required
* Content type
* Taxonomy / reference fields
* Views, what field is the filter applied on
...Also, how is this different from https://www.drupal.org/project/search_api_algolia/issues/3223351 ✨ Handle 'IN' operator Needs review ?
- 🇧🇪Belgium dieterholvoet Brussels
I also added support for NOT IN operators to the MR.