Andreas Lanz (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate Search (
https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiYzZmYjUz...
) / Bug (
https://hibernate.atlassian.net/browse/HSEARCH-4915?atlOrigin=eyJpIjoiYzZ...
) HSEARCH-4915 (
https://hibernate.atlassian.net/browse/HSEARCH-4915?atlOrigin=eyJpIjoiYzZ...
) Errors returned by OpenSearch/ElasticSearch not handled correctly (
https://hibernate.atlassian.net/browse/HSEARCH-4915?atlOrigin=eyJpIjoiYzZ...
)
Issue Type: Bug Affects Versions: 6.1.5.Final Assignee: Unassigned Components:
backend-elasticsearch Created: 10/Aug/2023 06:41 AM Priority: Major Reporter: Andreas Lanz
(
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Hello,
the last few days we’ve been digging into an issue where one of our queries send to
OpenSearch did not return the expected results. After some digging we found out that when
pasting the query into the OpenSearch dashboard we’re getting an error from OpenSearch
about “too_many_nested_clauses: Query contains too many nested clauses; maxClauseCount is
set to 1024”.
Turning on tracing in of requests in Hibernate Search we can see that OpenSearch is
returning the same error here too. However, this error does not seem to be processed by
Hibernate Search and the query returns normally just without any results. Here are some
relevant parts from the Response:
org.hibernate.search.elasticsearch.request: HSEARCH400093: Executed Elasticsearch HTTP
POST request to 'http://opensearch:9200' with path
'/my-index1-read,my-index2-read/_search', query parameters {size = 10000, scroll =
30s, track_total_hits = true } and 1 objects in payload in 932ms.Response had status 200
'OK'.Request body: < {"query": long query....}> .Response body:
< {
"_scroll_id": "FG...\u003d\u003d",
"took": 927,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 1,
"skipped": 0,
"failed": 1,
"failures": [{
"shard": 0,
"index": "my-index1-000001",
"node": "...",
"reason": {
"type": "too_many_nested_clauses",
"reason": "too_many_nested_clauses: Query contains too
many nested clauses; maxClauseCount is set to 1024"
}
}
]
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"hits": []
}
}
As you can see from the log one of the shards failed executing the query because it’s too
complex.
I would have expected Hibernate Search to throw an exception in such case so the system is
aware that something went wrong with the query. However browsing the code I could not find
any place where the _shards part of the response is actually evaluated.
(
https://hibernate.atlassian.net/browse/HSEARCH-4915#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-4915#add-comment?atlOrigin...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100234- sha1:6fcbbaf )