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

fixing embed mode #16642

Closed
wants to merge 1 commit into from
Closed

fixing embed mode #16642

wants to merge 1 commit into from

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Feb 9, 2018

Fixes #16595

@Bargs would it ever be a problem if we apply the same filter twice ?

dashboard currently set the filters and query by setting a new root search source
visualize editor however does't do that and we need to add them at the visualizations search source.

thats not ideal and this is just ment as a quick fix, look at the #16641 for more information on what we plan to do in the future.

with this fix we would always get the parameters out of appState, which means that on the dashboard same filters would be set twice (once by setting the rootsearchsource and once by courier response handler reading them out of appState)

we can't remove setting of the rootsearchsource as that would break the embeddable saved search

@ppisljar ppisljar added Feature:Add Data Add Data and sample data feature on Home Project:Accessibility 6.2.2 labels Feb 9, 2018
@ppisljar ppisljar requested review from timroes and Bargs February 9, 2018 14:13
@ppisljar ppisljar added review Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v6.2.1 and removed 6.2.2 Feature:Add Data Add Data and sample data feature on Home Project:Accessibility labels Feb 9, 2018
@elasticmachine
Copy link
Contributor

💔 Build Failed

@ppisljar
Copy link
Member Author

ppisljar commented Feb 9, 2018

jenkins, test this

Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

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

If Matt doesn't see an issue with that, that we missed, LGTM

@timroes timroes added v6.2.2 and removed v6.2.1 labels Feb 9, 2018
@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@Bargs Bargs left a comment

Choose a reason for hiding this comment

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

This does have the unfortunate effect of sending duplicate queries to ES if the same filter is added to two different SearchSources in the same SearchSource hierarchy. See the example request below, which I generated by clicking on a vis on a dashboard with this PR checked out. I don't know if such duplication will cause any problems, but it's probably best if we avoid it. What changed between 6.1.2 and 6.2.0? How did this used to work?

"query": {
    "bool": {
      "must": [
        {
          "match_all": {}
        },
        {
          "match_all": {}
        },
        {
          "match_phrase": {
            "machine.os.raw": {
              "query": "win 8"
            }
          }
        },
        {
          "match_phrase": {
            "machine.os.raw": {
              "query": "win 8"
            }
          }
        },
        {
          "range": {
            "@timestamp": {
              "gte": 1510762300048,
              "lte": 1518538300048,
              "format": "epoch_millis"
            }
          }
        }
      ],
      "filter": [],
      "should": [],
      "must_not": []
    }

@timroes
Copy link
Contributor

timroes commented Feb 14, 2018

@Bargs unfortunately the embedding mode was just broken for quite some time, that's why this didn't work for quite some time. I think embedding was broken since 6.0(?) and so it broke at the same time, that larger refactorings were made, meaning we cannot simply convert back to the working state.

If you consider this problematic, let's first wait until we had some discussions about #16641 and see if we will come up there also with a short term fix for the issue.

@Bargs
Copy link
Contributor

Bargs commented Feb 14, 2018 via email

@jimgoodwin jimgoodwin added v6.2.3 and removed v6.2.2 labels Feb 20, 2018
@stacey-gammon
Copy link
Contributor

Don't know if this is related, but I noticed before I went on leave (so early January) that filterBarClickHandler wasn't being used at all in the visualize embeddable factory. If you are trying to track down where the filtering broke, maybe that info will help. It was being used at some point...

@stacey-gammon
Copy link
Contributor

Also, I think we should try to add a functional test that would have caught this issue. With all the refactoring that will be happening soon in regards to filtering and search source, it will be good to cover the corner cases. I can help too, since it'll probably be a test in the dashboard suite, but I think it'll be good to get it in with this PR so we can make sure it fails before this fix, and passes after it.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@poor-bob
Copy link

poor-bob commented Mar 5, 2018

This is awesome, can't wait!

I figured I'd share why some of your edge cases exist:

we hijack a lot of the functionality into easy to select drop-downs, and steal the on-click event to switch between different loaded visualizations to achieve a drilldown effect.

image

final drilldown layer:
image

@jimgoodwin jimgoodwin added v6.2.4 and removed v6.2.3 labels Mar 20, 2018
@elasticmachine
Copy link
Contributor

💔 Build Failed

@ppisljar
Copy link
Member Author

closing in favour of #19172

@ppisljar ppisljar closed this Jun 13, 2018
@ppisljar ppisljar deleted the fix/editorMode2 branch June 13, 2018 08:05
@ppisljar ppisljar restored the fix/editorMode2 branch September 26, 2018 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Embedded Snapshot Visualizations 'Filter' broken; not firing _msearch call 6.2.0
7 participants