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

Using script_fields turns off _source retrieval #19403

Closed
Bargs opened this issue Jul 12, 2016 · 2 comments
Closed

Using script_fields turns off _source retrieval #19403

Bargs opened this issue Jul 12, 2016 · 2 comments

Comments

@Bargs
Copy link

Bargs commented Jul 12, 2016

Elasticsearch version: master (6861d35)
JVM version: 1.8.0_60
OS version: OSX 10.11.4

Description of the problem including expected versus actual behavior:

I recently discovered in Kibana master that creating a script field prevents other fields from loading on the Discover tab elastic/kibana#7699. The problem is that when script_fields is present in the query body, _source is no longer returned for each hit. Nothing has changed in the Kibana query as far as I can tell, so I think this is a change in behavior for ES.

Steps to reproduce:

  1. Execute a query without script_fields, see that _source is returned by default.
  2. Execute the same query with script_fields (any simple script should do, but it can't just be an empty object), see that _source is now missing
@clintongormley
Copy link
Contributor

Yes, it has always been this way. The idea is that if you are specifying custom fields, then you don't want the full _source. Turn return the _source with script fields, just set ?_source=true

@Bargs
Copy link
Author

Bargs commented Jul 14, 2016

Thanks @clintongormley, I see what changed in Kibana now. Sorry for the false alarm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants