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] model search doesn't recognize _source field #419

Closed
wanglam opened this issue Sep 9, 2022 · 1 comment
Closed

[BUG] model search doesn't recognize _source field #419

wanglam opened this issue Sep 9, 2022 · 1 comment
Labels
bug Something isn't working Severity-Major

Comments

@wanglam
Copy link

wanglam commented Sep 9, 2022

What is the bug?
I am using the model search API to get all trained model. But the API still response all fields even I pass _source field in the query body. The query like:

POST /_plugins/_ml/models/_search
{
  "_source": ["name"],
  "query":{
    "match_all":{
      
    }
  }
}

How can one reproduce the bug?
Just use query like

POST /_plugins/_ml/models/_search
{
  "_source": ["name"],
  "query":{
    "match_all":{
      
    }
  }
}

What is the expected behavior?
Should only response name field in the response _source.

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

Do you have any screenshots?
image
The model_content field is also returned.

Do you have any additional context?
Nope.

@wanglam wanglam added bug Something isn't working untriaged labels Sep 9, 2022
@ylwu-amzn
Copy link
Collaborator

Thanks for reporting this bug. This is caused by source context rewrite in AbstractMLSearchAction.java. We should keep original fetch source in method getSourceContext

@rbhavna can you help fix this bug?

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

No branches or pull requests

3 participants