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

Cannot disable stored fields #701

Closed
valasatava opened this issue Nov 7, 2023 · 2 comments
Closed

Cannot disable stored fields #701

valasatava opened this issue Nov 7, 2023 · 2 comments
Labels
Category: Bug Something isn't working

Comments

@valasatava
Copy link

Java API client version

8.10.3

Java version

11

Elasticsearch Version

8.9.1

Problem description

I need to disable the retrieval of all stored_fields like _source and _id using this recipe: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#disable-stored-fields.

I use the following Java client API:

new SearchRequest.Builder().storedFields("_none_")

However, the Java client always sends "stored_fields":["none"] and subsequently throws an error:

{
  "error": {
    "root_cause": [
      {
        "type": "null_pointer_exception",
        "reason": """Cannot invoke "java.util.List.size()" because the return value of "org.elasticsearch.search.fetch.StoredFieldsContext.fieldNames()" is null"""
      }
    ],
    "type": "null_pointer_exception",
    "reason": """Cannot invoke "java.util.List.size()" because the return value of "org.elasticsearch.search.fetch.StoredFieldsContext.fieldNames()" is null"""
  },
  "status": 500
}
@l-trotta
Copy link
Contributor

same as #700, #680

@l-trotta l-trotta added the Category: Bug Something isn't working label Apr 24, 2024
@l-trotta
Copy link
Contributor

fixed in the code generator, will be part of the next release!

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

No branches or pull requests

2 participants