Problem/Motivation

Currently, if there are multiple filters on indexed fields for a Search API view using an Algolia index, the foreach loop in SearchApiAlgoliaBackend::extractConditions overwrites $options['filters'] on each pass, resulting in invalid syntax and an error message `filters: Unexpected token 'AND' expected filter at col 1`.

Steps to reproduce

Create a view of an Algolia index. Add 2 or more filters on indexed fields and preview the result - the above error message will be shown.

Proposed resolution

Attached patch concatenates multiple filters into the filters option, to generate valid syntax.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bgilhome created an issue. See original summary.

bgilhome’s picture

A re-roll to be compatible with the patch in https://www.drupal.org/project/search_api_algolia/issues/3223351

nicolas bouteille’s picture

Status: Needs review » Reviewed & tested by the community

So lucky you fixed it for us, thank you for sharing this!

nikunjkotecha’s picture

Status: Reviewed & tested by the community » Needs work

Need an MR to review and merge.

shubhangi1995’s picture

Assigned: Unassigned » shubhangi1995

dieterholvoet made their first commit to this issue’s fork.

dieterholvoet’s picture

Status: Needs work » Needs review
dieterholvoet’s picture

Assigned: shubhangi1995 » Unassigned
dieterholvoet’s picture

Status: Needs review » Closed (outdated)