{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/kibana/issues/26356","repository_url":"https://api.github.com/repos/elastic/kibana","labels_url":"https://api.github.com/repos/elastic/kibana/issues/26356/labels{/name}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/26356/comments","events_url":"https://api.github.com/repos/elastic/kibana/issues/26356/events","html_url":"https://github.com/elastic/kibana/issues/26356","id":385389693,"node_id":"MDU6SXNzdWUzODUzODk2OTM=","number":26356,"title":"[Kibana App] Adapt to new hits.total format in Elasticsearch","user":{"login":"timroes","id":877229,"node_id":"MDQ6VXNlcjg3NzIyOQ==","avatar_url":"https://avatars0.githubusercontent.com/u/877229?v=4","gravatar_id":"","url":"https://api.github.com/users/timroes","html_url":"https://github.com/timroes","followers_url":"https://api.github.com/users/timroes/followers","following_url":"https://api.github.com/users/timroes/following{/other_user}","gists_url":"https://api.github.com/users/timroes/gists{/gist_id}","starred_url":"https://api.github.com/users/timroes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timroes/subscriptions","organizations_url":"https://api.github.com/users/timroes/orgs","repos_url":"https://api.github.com/users/timroes/repos","events_url":"https://api.github.com/users/timroes/events{/privacy}","received_events_url":"https://api.github.com/users/timroes/received_events","type":"User","site_admin":false},"labels":[{"id":1055842724,"node_id":"MDU6TGFiZWwxMDU1ODQyNzI0","url":"https://api.github.com/repos/elastic/kibana/labels/:KibanaApp","name":":KibanaApp","color":"fef2c0","default":false},{"id":135230660,"node_id":"MDU6TGFiZWwxMzUyMzA2NjA=","url":"https://api.github.com/repos/elastic/kibana/labels/blocker","name":"blocker","color":"e11d21","default":false},{"id":1124458249,"node_id":"MDU6TGFiZWwxMTI0NDU4MjQ5","url":"https://api.github.com/repos/elastic/kibana/labels/v8.0.0","name":"v8.0.0","color":"ffffff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-28T17:57:33Z","updated_at":"2018-11-28T19:14:43Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Once https://github.com/elastic/elasticsearch/pull/35849 is merged the format of `hits.total` as returned by Elasticsearch will change. We need to cater for that, since we read out `hits.total` in some places.\r\n\r\nThe way we are planning to do this is the following:\r\n\r\n* **Step 1**: Add `rest_total_hits_as_int=true` to all requests, that we need to get `hits.total` from in the end. This will cause the API to return the old format for requests, where nothing changed. Since this parameter is available since 6.6, we can backport that change to the `6.x` branch.\r\n* **Step 2**: Once we don't have much work going on on the `6.x` branch anymore (after 7.0 release), adopt all places that are consuming `hits.total` to the new format, and switch over the parameter to use `track_total_hits=true` instead to get the exact result in all those requests.\r\n* **Step 3**: Analyze if there are any places where we don't need the exact matches and could potentially replace this by showing the estimated hits as with the new behavior.\r\n\r\nWe are going this way, since that allows us to have `master` and `6.x` branch in sync before the 7.0 release. If we would directly switch to the new format, we can't backport this change to `6.x` and thus `master` and `6.x` will have a different state in all the places we are accessing `hits.total` and are executing a query. Since this will make backporting future changes to `6.x` more difficult we won't change to the new format as long as we are still actively developing features on `6.x`.\r\n\r\nSince the `rest_total_hits_as_int` parameter is scheduled for removal in 8.0, I will directly mark this issue as a blocker for 8.0 as a reminder, that step 2 needs to be implemented till then.\r\n\r\n### Related issues\r\n\r\n* Infra UI (#26351)\r\n\r\n### CC\r\n\r\nSince I did a quick search through the repository for `hits.total` it seems the following teams are effected and might establish a similar progress for moving over.\r\n\r\ncc @elastic/kibana-platform used in es_archiver and saved objects\r\ncc @elastic/apm-ui Used in a couple of places\r\ncc @elastic/ml-ui Used in a couple of places\r\ncc @elastic/kibana-management (I couldn't find a handle for elasticsearch UI yet): used in watcher\r\ncc whoever manages Stack monitoring"},"comment":{"url":"https://api.github.com/repos/elastic/kibana/issues/comments/442569210","html_url":"https://github.com/elastic/kibana/issues/26356#issuecomment-442569210","issue_url":"https://api.github.com/repos/elastic/kibana/issues/26356","id":442569210,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjU2OTIxMA==","user":{"login":"LeeDr","id":13542669,"node_id":"MDQ6VXNlcjEzNTQyNjY5","avatar_url":"https://avatars1.githubusercontent.com/u/13542669?v=4","gravatar_id":"","url":"https://api.github.com/users/LeeDr","html_url":"https://github.com/LeeDr","followers_url":"https://api.github.com/users/LeeDr/followers","following_url":"https://api.github.com/users/LeeDr/following{/other_user}","gists_url":"https://api.github.com/users/LeeDr/gists{/gist_id}","starred_url":"https://api.github.com/users/LeeDr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeeDr/subscriptions","organizations_url":"https://api.github.com/users/LeeDr/orgs","repos_url":"https://api.github.com/users/LeeDr/repos","events_url":"https://api.github.com/users/LeeDr/events{/privacy}","received_events_url":"https://api.github.com/users/LeeDr/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T19:14:43Z","updated_at":"2018-11-28T19:14:43Z","author_association":"CONTRIBUTOR","body":"We'll need to test Kibana N.M -> Elasticsearch N.M+1 \r\nK6.5 with E6.6\r\nK6.6 with E6.7\r\n\r\nand Kibana N.M -> Elasticsearch N+1 .0\r\nK6.7 with E7.0 (maybe also K6.6 with E7.0)\r\n\r\nbecause users can upgrade their Elasticsearch before their Kibana and everything needs to work."}}
{"actor":{"display_login":"LeeDr"}}