You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are migrating our service from Elasticsearch 7.10 to Opensearch. This behavior prevents certain queries from functioning correctly, potentially affecting applications relying on exists queries for flattened fields.
Request
We kindly request the community to investigate this issue. If this behavior is by design, clarification in the documentation would be helpful. If it is a bug, we hope for a fix or a recommended workaround.
Thank you for your assistance!
The text was updated successfully, but these errors were encountered:
There are a lot of problems with the current flat_object implementation, but for compatibility reasons we need to address them in a new version, which is currently under development, you can refer to #16061.
As for your exists query, this is because the current implementation uses an inverted index under field name to perform the query, and this inverted index will only resolve the last level of subfields, e.g. for the example you gave, there will only be a mapping of earth -> earth.north, so it will give the wrong result, if we use doc values to implement exists query, we should be able to solve this problem. If we implement an exists query using doc values, we should be able to solve this problem.
Describe the bug
We have encountered a discrepancy between Elasticsearch and OpenSearch when querying exists on flattened fields with dotted sub-field names.
related topic #11425
Related component
Search:Query Capabilities
To Reproduce
Expected behavior
The query should return the indexed document, as the field
earth.american.north
exists in the document.Observed Behavior
In Elasticsearch (7.10): The query returns the expected document.
In OpenSearch (2.18): The query does not return any results.
Additional Details
Analysis
The issue appears to be related to how OpenSearch handles exists queries on flattened fields with dotted sub-field names. Specifically:
exists
onearth.american.north
does not behave as expected.term
queries, where such fields work correctly, as it supported in this PR Fix parsing of flat object fields with dots in keys #11425american.north
is not supported.Impact
We are migrating our service from Elasticsearch 7.10 to Opensearch. This behavior prevents certain queries from functioning correctly, potentially affecting applications relying on exists queries for flattened fields.
Request
We kindly request the community to investigate this issue. If this behavior is by design, clarification in the documentation would be helpful. If it is a bug, we hope for a fix or a recommended workaround.
Thank you for your assistance!
The text was updated successfully, but these errors were encountered: