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

Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. #7542

Merged
merged 1 commit into from
Jul 5, 2016

Conversation

cjcenizal
Copy link
Contributor

@cjcenizal cjcenizal commented Jun 24, 2016

Issues addressed:

1) plugins/elasticsearch routes POST /elasticsearch/_msearch?timeout=0&ignore_unavailable=true&preference=1429577952339 should should return 200:
     Error: expected 400 to equal 200
      at Assertion.assert (node_modules/expect.js/index.js:96:13)
      at Assertion.be.Assertion.equal (node_modules/expect.js/index.js:216:10)
      at Assertion.(anonymous function) [as be] (node_modules/expect.js/index.js:69:24)
      at src/plugins/elasticsearch/lib/__tests__/routes.js:42:41
      at node_modules/hapi/lib/connection.js:281:16
      at node_modules/hapi/node_modules/shot/lib/index.js:206:13

@ycombinator identified this change to ES as the culprit: elastic/elasticsearch@2f46f53

@ycombinator
Copy link
Contributor

ycombinator commented Jun 24, 2016

@cjcenizal Thanks for creating this PR. I suspect this change is needed in several other places as well. I'm not sure of the extent but it probably makes sense to group the same change (in several places) into this PR.

P.S. I realize there is a build failure for an unrelated, different ES change with _timestamp. I would keep any changes related to that out of this PR.

@Bargs
Copy link
Contributor

Bargs commented Jun 24, 2016

Looks like this is causing an issue in Kibana itself as well #7541

@cjcenizal cjcenizal changed the title Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. WIP: Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. Jun 24, 2016
@jbudz
Copy link
Member

jbudz commented Jun 24, 2016

This is going to require/be dependent on a new elasticsearch client library publish.

@@ -105,7 +105,7 @@ describe('plugins/elasticsearch', function () {
testRoute({
method: 'POST',
url: '/elasticsearch/_msearch?timeout=0&ignore_unavailable=true&preference=1429577952339',
payload: '{"index":"logstash-2015.04.21","ignore_unavailable":true}\n{"size":500,"sort":{"@timestamp":"desc"},"query":{"bool":{"must":[{"query_string":{"analyze_wildcard":true,"query":"*"}},{"bool":{"must":[{"range":{"@timestamp":{"gte":1429577068175,"lte":1429577968175}}}],"must_not":[]}}],"must_not":[]}},"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}}},"aggs":{"2":{"date_histogram":{"field":"@timestamp","interval":"30s","min_doc_count":0,"extended_bounds":{"min":1429577068175,"max":1429577968175}}}},"fields":["*","_source"],"script_fields":{},"fielddata_fields":["timestamp_offset","@timestamp","utc_time"]}\n' // eslint-disable-line max-len
payload: '{"index":"logstash-2015.04.21","ignore_unavailable":true}\n{"size":500,"sort":{"@timestamp":"desc"},"query":{"bool":{"must":[{"query_string":{"analyze_wildcard":true,"query":"*"}},{"bool":{"must":[{"range":{"@timestamp":{"gte":1429577068175,"lte":1429577968175}}}],"must_not":[]}}],"must_not":[]}},"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}}},"aggs":{"2":{"date_histogram":{"field":"@timestamp","interval":"30s","min_doc_count":0,"extended_bounds":{"min":1429577068175,"max":1429577968175}}}},"stored_fields":["*","_source"],"script_fields":{},"fielddata_fields":["timestamp_offset","@timestamp","utc_time"]}\n' // eslint-disable-line max-len
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the point in having stored_fields: [ "*", "_source"] ? we can just leave out this parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per Zoom discussion, we'll make a list of all the places this type of reference exists, and then make a separate PR for removing them. CC @jbudz

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to return the source regardless, then use "_source": true, so to return all stored fields AND the source, use:

"stored_fields": "*",
"_source": true

@uboness
Copy link

uboness commented Jun 24, 2016

@jbudz
Copy link
Member

jbudz commented Jun 24, 2016

#7546 should fix the functional tests _timestamp issue

@cjcenizal cjcenizal force-pushed the bug/msearch-test-stored-fields branch from 5f6deea to 0b02e38 Compare June 24, 2016 16:45
@cjcenizal cjcenizal force-pushed the bug/msearch-test-stored-fields branch from 7ee3e42 to 82980d2 Compare June 24, 2016 22:39
@cjcenizal cjcenizal changed the title WIP: Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. Jun 24, 2016
@jbudz jbudz added review and removed blocked labels Jun 24, 2016
@jbudz
Copy link
Member

jbudz commented Jun 24, 2016

jenkins, test it

@@ -77,7 +77,7 @@ modules.get('apps/management')
_.defaults(this.indexPattern, {
id: this.patternInput.defaultValue,
title: 'filebeat-*',
fields: _(sampleFields)
stored_fields: _(sampleFields)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apologies, this one should still be fields

@cjcenizal cjcenizal force-pushed the bug/msearch-test-stored-fields branch from 685ef4c to 1169670 Compare June 25, 2016 00:04
@spalger
Copy link
Contributor

spalger commented Jun 25, 2016

LGTM

@@ -69,7 +69,7 @@ module.service('savedDashboards', function (Promise, SavedDashboard, kbnIndex, e
query: {
simple_query_string: {
query: searchString + '*',
fields: ['title^3', 'description'],
stored_fields: ['title^3', 'description'],
Copy link

@uboness uboness Jun 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... afaik we didn't change the simple_query_string query... are you sure this is working?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems dubious - we search indexed fields not stored ones so either way is odd naming.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should definitely be fields, not stored_fields

@cjcenizal cjcenizal changed the title Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. [WIP]: Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. Jun 27, 2016
@cjcenizal
Copy link
Contributor Author

TODO: We can merge this after elasticsearch un-reverts their "fields -> stored_fields" change. Then we can squash these commits, and rebase master onto this branch to bring everything up to date. Then we should be good to merge.

@epixa
Copy link
Contributor

epixa commented Jul 5, 2016

Merging this would happen after all of those things :)

@cjcenizal
Copy link
Contributor Author

Note: the "fields -> stored_fields" change has been unreverted in ES: elastic/elasticsearch@afe99fc

@cjcenizal cjcenizal force-pushed the bug/msearch-test-stored-fields branch 2 times, most recently from dd0c399 to 7cbea3f Compare July 5, 2016 14:05
@cjcenizal cjcenizal changed the title [WIP]: Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API. Jul 5, 2016
@cjcenizal cjcenizal force-pushed the bug/msearch-test-stored-fields branch from 7cbea3f to 3c71b6e Compare July 5, 2016 14:52
…ch API.

- Upgrade elasticsearch client to 12.0.0-rc4.
@cjcenizal cjcenizal force-pushed the bug/msearch-test-stored-fields branch from 3c71b6e to d9cf54f Compare July 5, 2016 15:02
@jbudz
Copy link
Member

jbudz commented Jul 5, 2016

rebase LGTM

@ycombinator
Copy link
Contributor

ycombinator commented Jul 5, 2016

I'm seeing an issue in the doc viewer in the Discover view. If I expand on one of the rows, both the Table and JSON tabs are empty:

screen shot 2016-07-05 at 8 25 00 am

screen shot 2016-07-05 at 8 25 07 am

There are no errors in the developer console.

I'm not entirely sure this issue is a result of the changes in this PR. Unfortunately master is completely broken without this PR so I can't compare against that. I'm comparing against 5.0.0-alpha4 now...

@jbudz
Copy link
Member

jbudz commented Jul 5, 2016

@ycombinator you'll want to use es master for this, this should fix the break

@ycombinator
Copy link
Contributor

@jbudz I am using ES master, specifically this commit SHA: elastic/elasticsearch@dec620c

@jbudz
Copy link
Member

jbudz commented Jul 5, 2016

Ah I misunderstood, got it.

@ycombinator
Copy link
Contributor

BTW, just confirmed that Kibana 5.0.0-alpha4 does not show the empty table or JSON issue I reported in #7542 (comment).

@jbudz jbudz mentioned this pull request Jul 5, 2016
@jbudz
Copy link
Member

jbudz commented Jul 5, 2016

Opened #7628

@ycombinator
Copy link
Contributor

Thanks @jbudz. Given that the issue I reported is unrelated to this PR, I'll continue reviewing this PR.

@ycombinator
Copy link
Contributor

LGTM.

@ycombinator ycombinator removed their assignment Jul 5, 2016
@cjcenizal cjcenizal merged commit 5588983 into elastic:master Jul 5, 2016
@cjcenizal cjcenizal deleted the bug/msearch-test-stored-fields branch July 5, 2016 18:32
@epixa epixa added v5.0.0 and removed v5.0.0 labels Aug 1, 2016
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
…d-fields

Rename 'fields' property to 'stored_fields' in routes.js test to adhere to new ES msearch API.

Former-commit-id: 5588983
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.

10 participants