- Issue created by @rené bakx
- Status changed to Needs review
3 months ago 3:21pm 10 September 2024
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)
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.
A small change in Drupal\search_api_meilisearch\Parser\ScalarValueParser.php
that changes the value into 'true' or 'false' will fix this issue.
I did try to move the value fix to MeilisearchUtils::formatConditionValue
function, however that would imply that the current field or field_type would be added to that method and that makes no sense for any other value except a boolean.
Check MR !53 as proposed solution.
None
None
None
Needs review
2.0
Code