Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Make id of Hit Nullable #696

Closed
hubertazg opened this issue Oct 31, 2023 · 1 comment · Fixed by #698
Closed

[BUG] Make id of Hit Nullable #696

hubertazg opened this issue Oct 31, 2023 · 1 comment · Fixed by #698
Assignees
Labels
bug Something isn't working untriaged

Comments

@hubertazg
Copy link

What is the bug?

Executing a search from Java Opensearch client by disabling stored fields ("stored_fields: none") fails with an MissingRequiredPropertyException. Even though, the query is executed by the Opensearch server (confirmed through Opensearch console), the Java client cannot process a response with null _id field.

How can one reproduce the bug?

Create a new query with stored_fields as none and opensearch client will throw an error.
SearchRequest.Builder searchRequest = new SearchRequest.Builder(); searchRequest.storedFields("_none_"); return searchRequest.build();
Execute the above search request for any filter/query and you can notice that the Java client throws an MissingRequiredPropertyException: Missing Required Property 'Hit.id'

What is the expected behavior?

Since the query with "none" stored fields is executed by opensearch server, the Java client should be able to process it and return the response without throwing an exception.

What is your host/environment?

Opensearch Java - 2.7.0

Do you have any screenshots?

Screen Shot 2023-10-27 at 5 00 18 PM

Do you have any additional context?

Searching & Retrieving documents with id field is very slow potentially due to reading the id from stored fields. Executing the search by disabling stored fields (by using "stored_fields: none") makes the search faster. However, the Java client cannot process responses with null Id from Opensearch server.

@hubertazg hubertazg added bug Something isn't working untriaged labels Oct 31, 2023
@VachaShah VachaShah self-assigned this Oct 31, 2023
@dblock
Copy link
Member

dblock commented Oct 31, 2023

Looks like a legit problem. Want to try and write a (failing) unit test for this @hubertazg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants