Boolean fields don't work when used as views filters

Created on 10 September 2024, about 1 year ago

Problem/Motivation

When using a view to display the output of an search_api_index, for example to create an overview page with several filters on it. Boolean fields are queried using 1 or 0 instead of 'true' or 'false'.

Meilisearch stores booleans as lowercase string (see https://www.meilisearch.com/docs/learn/engine/datatypes#boolean)

Steps to reproduce

Create a index and store a boolean field on that index, as type 'boolean'
Create a view for that index, and filter on that boolean field.

The filter won't work, and in worse case scenario your view will remain empty.

Proposed resolution

A small change in Drupal\search_api_meilisearch\Parser\ScalarValueParser.php that changes the value into 'true' or 'false' will fix this issue.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ณ๐Ÿ‡ฑNetherlands rene bakx Netherlands

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024