Skip to content

Restore _source fetching behavior#7751

Merged
Bargs merged 1 commit intoelastic:masterfrom
Bargs:restoreSource
Jul 14, 2016
Merged

Restore _source fetching behavior#7751
Bargs merged 1 commit intoelastic:masterfrom
Bargs:restoreSource

Conversation

@Bargs
Copy link
Copy Markdown
Contributor

@Bargs Bargs commented Jul 14, 2016

Kibana used to always include a fields parameter on Discover search
requests which included '_source' so that ES would return the _source
field for each hit. When ES removed the fields param we attempted to
switch to a new request body param _source: true to maintain the
same behavior. However, we missed one spot in the code that needed
updating in order to pass that param along to the actual request json.

This problem wasn't immediately obvious because _source is included by
default. However, this fixes a related issue where _source fields were
missing in Discover if any scripted fields existed. The presence of the
script_fields param in the request would disabled the automatic return
of _source. Now that we're correctly passing _source: true, _source
fetching works correctly even when scripted fields are present.

Fixes #7699

Kibana used to always include a `fields` parameter on Discover search
requests which included '_source' so that ES would return the _source
field for each hit. When ES removed the `fields` param we attempted to
switch to a new request body param `_source: true` to maintain the
same behavior. However, we missed one spot in the code that needed
updating in order to pass that param along to the actual request json.

This problem wasn't immediately obvious because _source is included by
default. However, this fixes a related issue where _source fields were
missing in Discover if any scripted fields existed. The presence of the
`script_fields` param in the request would disabled the automatic return
of _source. Now that we're correctly passing `_source: true`, _source
fetching works correctly even when scripted fields are present.

Fixes elastic#7699
@Bargs
Copy link
Copy Markdown
Contributor Author

Bargs commented Jul 14, 2016

Amended my commit to include stored_fields as well. Now I think this should be functionally equivalent to what we had before.

@jbudz
Copy link
Copy Markdown
Contributor

jbudz commented Jul 14, 2016

LGTM

1 similar comment
@cjcenizal
Copy link
Copy Markdown
Contributor

LGTM

@Bargs Bargs merged commit 33b3c45 into elastic:master Jul 14, 2016
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
Restore _source fetching behavior

Former-commit-id: 33b3c45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scripted fields prevent regular fields from appearing on Discover

4 participants