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

[8.11] [fix] Using max_result_window to set up MVT size request leads to not showing all results (#171344) #171440

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.11:

Questions ?

Please refer to the Backport tool documentation

… showing all results (elastic#171344)

Closes elastic#170272

The cause of the problem is that Maps is not setting
[_mvt](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-vector-tile-api.html)
`size` parameter.

Lets illustrate the problem with an example.
* index.max_result_window is set to 20,000.
* There are 15,000 hits matching the query for the tile, but because
`size` is not provided, the tile returns the default size value of
10,000 hits.
* Tile request sets `track_total_hits` to 20,001. Tile meta returns
`"hits.total.relation": "eq"` and `"hits.total.value": 15000`
properties, indicating that all possible hits are returned in the tile.
* Maps UI does not display "incomplete results" even though 5000 hits
are not contained in the tile.
* This happens because `hits.total` properties from tile meta is used to
indicate "incomplete results" and the returned value indicates that all
results are contained in the tile. We know this is not true because the
tile actually only returned 10,000 hits and not all 15,000 matching
hits. Thus, without setting `size`, the tile is not returning all of the
hits indicated by `track_total_hits`.

### test instructions
1. install web logs sample data set
2. In dev tools, run the following
    ```
    POST kibana_sample_data_logs/_doc/
    {
      "geo": {
        "coordinates": "59,-106.5"
      },
      "@timestamp": "2023-08-01"
    }

    PUT /kibana_sample_data_logs/_settings
    {
      "index" : {
        "max_result_window" : 20000
      }
    }
    ```
3. Create new map
4. Set time range to `1 year ago to 1 year from now` to display all web
logs data
5. add documents layer. Verify point circled in image is displayed.
Without changes, this point would not be returned in the tile because
the tile would only return the first 10000 matches.
<img width="500" alt="Screenshot 2023-11-15 at 11 31 25 AM"
src="https://github.com/elastic/kibana/assets/373691/2249d571-24c4-41ad-975e-d44ee6d246ce">

(cherry picked from commit 95a8d6a)
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 2.8MB 2.8MB +14.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nreese

@kibanamachine kibanamachine merged commit 7d33d5a into elastic:8.11 Nov 16, 2023
18 checks passed
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.

3 participants