Multiple filters error - 'filters' option overwritten

Created on 12 July 2021, over 3 years ago
Updated 30 September 2024, about 2 months ago

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.

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

🇨🇦Canada bgilhome Victoria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024