Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Amazon OpenSearch service 2.5 managed by AWS.
Describe the issue:
Today I found a bug on opensearch-java
library, if I set the setting maxAnalyzedOffset
on the Highlight.Builder
I immediately start to receive this exception:
19:00:59.853 [http-nio-auto-1-exec-1] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.opensearch.client.opensearch._types.OpenSearchException: Request failed: [x_content_parse_exception] [1:637] [highlight] unknown field [max_analyzed_offset] did you mean [max_analyzer_offset]?] with root cause
org.opensearch.client.opensearch._types.OpenSearchException: Request failed: [x_content_parse_exception] [1:637] [highlight] unknown field [max_analyzed_offset] did you mean [max_analyzer_offset]?
at org.opensearch.client.transport.rest_client.RestClientTransport.getHighLevelResponse(RestClientTransport.java:278)
at org.opensearch.client.transport.rest_client.RestClientTransport.performRequest(RestClientTransport.java:144)
at org.opensearch.client.opensearch.OpenSearchClient.search(OpenSearchClient.java:1302)
...
Digging a little bit I found that in OpenSearch project the setting is called [max_analyzer_offset] but in both Java and .net clients it is max_analyzed_offset
(same as ElasticSearch)
So I opened the issue #553 on the elasticsearch-java
repository.
But I’m wondering, should we fix the client libraries? Or should we change the max_analyzer_offset setting on OpenSearch to match the ElasticSearch one and also both Java and .net libraries?
Relevant Logs:
"error": {
"root_cause": [
{
"type": "x_content_parse_exception",
"reason": "[36:9] [highlight] unknown field [max_analyzed_offset] did you mean [max_analyzer_offset]?"
}
],
"type": "x_content_parse_exception",
"reason": "[36:9] [highlight] unknown field [max_analyzed_offset] did you mean [max_analyzer_offset]?"
},
"status": 400
}
PS: I have added many more hyperlinks but as a new user I can only add 2.