Reputation: 1
I have working environment of shopware 6.4 and elasticsearch 7.17. Es only sometimes return with exeption, most of the search term are found. There is no kibana working with es. In the logs there is shown a problem "Can't parse boolean value [0], expected [true] or [false]". I don't really know where to look for solution or hint for this problem. I know that from es version 6 only true or false are working. Is there posibility that some of the addons in shopware may be cosing this?
Any hint might help.
Here is the log error:
[2023-09-15T08:48:23.462839+00:00] request.CRITICAL: Uncaught PHP Exception Elasticsearch\Common\Exceptions\BadRequest400Exception: "{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: Can't parse boolean value [0], expected [true] or [false]","index_uuid":"Z-KvxYVyRzKeSEKaV23k6w","index":"sw_product_2fbb5fe2e29a4d70aa5854ce7ce3e20b_1694688320"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"sw_product_2fbb5fe2e29a4d70aa5854ce7ce3e20b_1694688320","node":"yW9O2-UCSlCoYctoSmeXPQ","reason":{"type":"query_shard_exception","reason":"failed to create query: Can't parse boolean value [0], expected [true] or [false]","index_uuid":"Z-KvxYVyRzKeSEKaV23k6w","index":"sw_product_2fbb5fe2e29a4d70aa5854ce7ce3e20b_1694688320","caused_by":{"type":"illegal_argument_exception","reason":"Can't parse boolean value [0], expected [true] or [false]"}}}]},"status":400}" at /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php line 693 {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"query_shard_exception\",\"reason\":\"failed to create query: Can't parse boolean value [0], expected [true] or [false]\",\"index_uuid\":\"Z-KvxYVyRzKeSEKaV23k6w\",\"index\":\"sw_product_2fbb5fe2e29a4d70aa5854ce7ce3e20b_1694688320\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"sw_product_2fbb5fe2e29a4d70aa5854ce7ce3e20b_1694688320\",\"node\":\"yW9O2-UCSlCoYctoSmeXPQ\",\"reason\":{\"type\":\"query_shard_exception\",\"reason\":\"failed to create query: Can't parse boolean value [0], expected [true] or [false]\",\"index_uuid\":\"Z-KvxYVyRzKeSEKaV23k6w\",\"index\":\"sw_product_2fbb5fe2e29a4d70aa5854ce7ce3e20b_1694688320\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"Can't parse boolean value [0], expected [true] or [false]\"}}}]},\"status\":400} at /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:693)"} []
I tried to find some solution online. Nothing helpful so far.
Upvotes: 0
Views: 236
Reputation: 6599
Try Checking for the DataType of the Column in your DB and ElasticSearch.
It looks like, you have a BooleanField in Elastic, and therefore,
ElasticSearch is expecting the value as true/false
(Boolean)
&, instead, you are sending the value as 0
(Integer)
Eg.
If my is_deleted
field in my Elastic is a BooleanField then, below, with an Integer value, will fail.
"terms": {"is_deleted": [0]}
I will need to change it to the following:
"terms": {"is_deleted": [false]}
Upvotes: 0