magento2: Elasticsearch parsing exception
Preconditions (*)
- Magento 2.3.1 or current
2.3-developbranch - Elasticserach 6.7.1
Steps to reproduce (*)
- Add dropdown product attribute with:
- Scope: global scope
- Unique value: no
- Add to Column options: yes
- Use inf Filter options: yes
- Use in search: yes
- Search for a term used in one of the dropdown’s options.
Expected result (*)
- Search results based on Elasticsearch
Actual result (*)
- Fallback search results based on MySQL search
- Exception:
[2019-04-25 08:06:28] main.CRITICAL: {"error":{"root_cause":[{"type":"parsing_exception","reason":"[terms] unknown token [START_ARRAY] after [in]","line":1,"col":115}],"type":"parsing_exception","reason":"[terms] unknown token [START_ARRAY] after [in]","line":1,"col":115},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"parsing_exception\",\"reason\":\"[terms] unknown token [START_ARRAY] after [in]\",\"line\":1,\"col\":115}],\"type\":\"parsing_exception\",\"reason\":\"[terms] unknown token [START_ARRAY] after [in]\",\"line\":1,\"col\":115},\"status\":400} at /home/xxx/public_html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:615)"} []
- Query sent to Elasticsearch looks like this:
"query": {
"bool": {
"must": [
{
"term": {
"category_ids": "222"
}
},
{
"terms": {
"manufacturer": {
"in": [
"166",
"53",
"65",
"66",
"164"
]
}
}
}
]
}
},
This isn’t valid ES query, manufacturer in terms shouldn’t include in parameter. When I manually tested without in it worked without any problem.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 7
- Comments: 21 (9 by maintainers)
Any news regarding this issue?
@sigismund and @MagentoSeba,
Thank you for your report and collaboration!
The issue has been fixed by Magento team in the scope of internal Jira tickets
MC-20381andMAGETWO-99427The fix has been delivered into2.3-developbranchRelated commit(s):
Hello @MagentoSeba
Thank you for the input and collaboration!
The issue was closed by mistake - were used not accurate steps to reproduce/preconditions. Now internal team has confirmed that issue can be reproduced by provided steps. The issue will be resolved in the scope of internal Jira ticket
MAGETWO-99427by Magento teamAs soon as it will be delivered into
2.3-develop, we provide a list of commits here as a comment.✅ Confirmed by @sdzhepa Thank you for verifying the issue. Based on the provided information internal tickets
MAGETWO-99427were createdIssue Available: @sdzhepa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
sure @sidolov !
The main error is :
The query in our case is :
If query modified by removing “in”, Elasticsearch works as expected.
@sigismund the issue is actually also in Magento Commerce 2.3.0, the @magento-engcom-team should be aware of that.
✅ Confirmed by @engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets
MAGETWO-99427were createdIssue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.