Do not generate msearch request for visualizations that set requiresSearch to false#9658
Do not generate msearch request for visualizations that set requiresSearch to false#9658ppisljar merged 2 commits intoelastic:masterfrom
Conversation
|
Can one of the admins verify this patch? |
|
jenkins, test this |
|
Thanks @nreese ! could you also add one test for this ? |
|
@ppisljar There is no existing test for the ui/public/visualize/visualize.js. How do I bootstrap a test for an angular directive? |
|
you can create tests folder anywhere you like and just put .js files in it and they will be run during tests. you can find some info on general angular controller testing here: https://docs.angularjs.org/guide/unit-testing you can see an example controller test here: https://github.com/elastic/kibana/tree/master/src/ui/public/kbn_top_nav |
|
jenkins, test this |
|
needs to be rebased on master for selenium tests to pass. |
a374001 to
3f91796
Compare
|
@thomasneirynck do you want to take second look ? |
thomasneirynck
left a comment
There was a problem hiding this comment.
sorry for the delay, this fell of my radar. thanks @nreese , nice addition!
|
jenkins, test this |
|
i think this needs to be rebased, CI is failling |
3f91796 to
592865c
Compare
|
I have rebased with master |
…earch to false Backports PR #9658 **Commit 1:** only watch searchSource when vis requires search * Original sha: 0b38c3c * Authored by nreese <reese.nathan@gmail.com> on 2016-12-27T19:27:42Z **Commit 2:** add test * Original sha: 592865c * Authored by nreese <reese.nathan@gmail.com> on 2017-01-12T03:36:04Z
…earch to false (#10466) Backports PR #9658 **Commit 1:** only watch searchSource when vis requires search * Original sha: 0b38c3c * Authored by nreese <reese.nathan@gmail.com> on 2016-12-27T19:27:42Z **Commit 2:** add test * Original sha: 592865c * Authored by nreese <reese.nathan@gmail.com> on 2017-01-12T03:36:04Z
|
thanks a lot @nreese |
Some visualizations do not require aggregation results. These include Markdown and Timelion. Visualizations that do not require aggregation results set the property
requiresSearchto false.Currently, the requiresSearch flag is not utilized when the
_msearchrequest is generated for a dashboard. Visualizations that set therequiresSearchflag to false still generate a search request. Under most situations, this extra request is harmless - other than wasting CPU cycles. When the dashboard contains filters that filter fields not present in the default index, the extra request results in Elasticsearchquery_shard_exceptionas defined in issue 9492.This PR updates the visualization to only watch the searchSource object (and therefore only create request objects) when the visualizations requires search.