SyliusElasticsearchPlugin
SyliusElasticsearchPlugin copied to clipboard
Unable to use checkbox filter
On product, I have many checkbox attributes. When I check "1" in the filter and I click on "Filter" button, I have this error :
An exception has been thrown during the rendering of a template ("failed to create query: {
"bool": {
"must": [
{
"term": {
"enabled": {
"value": true,
"boost": 1.0
}
}
},
{
"terms": {
"channels": [
"sylius"
],
"boost": 1.0
}
},
{
"terms": {
"product_taxons": [
"01"
],
"boost": 1.0
}
},
{
"range": {
"price_sylius": {
"from": 0,
"to": 9223372036854775807,
"include_lower": true,
"include_upper": true,
"boost": 1.0
}
}
},
{
"bool": {
"should": [
{
"term": {
"attribute_promotion": {
"value": "1",
"boost": 1.0
}
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
},
{
"bool": {
"should": [
{
"term": {
"attribute_news_auto": {
"value": "9a9bf86a_8e14_11ea_ad31_0242ac120005",
"boost": 1.0
}
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
} [index: bitbag_shop_products_dev] [reason: all shards failed]").
When I replace the "1" value by true in the query string, the filter work fine but the filter form is not checked.
Here's a quick POC in case someone needs to implement this feature https://github.com/vvasiloi/SyliusElasticsearchPlugin/commit/d006d35d530e81c59fab45e065efc7122f50b422
Issued a PR to fix this issue