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

[Maps] automatically disable filter by bounds for indexes with small doc counts #34456

Merged
merged 5 commits into from Apr 5, 2019

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Apr 3, 2019

We have noticed lots of users not properly setting Dynamically filter for data in the visible map area for Elasticsearch document sources. This PR detects if an index contains a limited number of documents and then automatically disables filter by bounds when the index would not benefit from bounds filtering. The UI shows a callout to highlight that filter by bounds has been disabled.

cc @gchaps Could you please review the callout messaging?

Screen Shot 2019-04-04 at 3 17 16 PM

To test, use an index with less than 2000 documents. Run the following command in console to load an ES index with just a single document

PUT /line
{
  "mappings": {
    "properties": {
      "location": {
        "type": "geo_shape"
      }
    }
  }
}

POST /line/_doc
{
  "location": {
     "type": "LineString",
        "coordinates": [
          [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]
        ]
  }
}

@nreese nreese added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation enhancement New value added to drive a business result v8.0.0 v7.2.0 labels Apr 3, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis

@nreese
Copy link
Contributor Author

nreese commented Apr 3, 2019

cc @alexfrancoeur What do you think about this?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

Here is a suggestion for shortening the text:

Dynamic data filter disabled

Index "example*" has a small number of documents and does not require filtering.

Turn on dynamic filtering if you expect the number of documents to increase.

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

nice touch. I'd expect this to be really useful too for a lot of the user-provide data coming from geojson-upload.

this.setState({
limit: isNaN(sanitizedValue) ? '' : sanitizedValue,
Copy link
Contributor

Choose a reason for hiding this comment

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

thx for removing cruft

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

handler: async (request, h) => {
const { server, query } = request;

if (!query.index) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Log a warning to the server-logs? This should never really occur, and if it does, it's unexpected and there is an issue with the stack deployment. Might be helpful to show feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could happen if someone uses the API and does not supply index query param. Is it worth logging? Consumer of API would get 400 and know something is wrong with the request

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

Callout message looks good.

@nreese nreese merged commit 23bdee0 into elastic:master Apr 5, 2019
nreese added a commit to nreese/kibana that referenced this pull request Apr 5, 2019
…doc counts (elastic#34456)

* [Maps] automatically disable filter by bounds for indexes with small doc counts

* text updates

* review feedback

* minor text update
nreese added a commit that referenced this pull request Apr 5, 2019
…doc counts (#34456) (#34600)

* [Maps] automatically disable filter by bounds for indexes with small doc counts

* text updates

* review feedback

* minor text update
chandlerprall pushed a commit to chandlerprall/kibana that referenced this pull request Apr 15, 2019
…doc counts (elastic#34456)

* [Maps] automatically disable filter by bounds for indexes with small doc counts

* text updates

* review feedback

* minor text update
@nreese nreese added release_note:enhancement and removed enhancement New value added to drive a business result labels May 22, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

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

Successfully merging this pull request may close these issues.

None yet

4 participants