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

Sort sub-aggregation axis by term not working #10648

Closed
pemontto opened this issue Mar 2, 2017 · 9 comments · Fixed by #118338
Closed

Sort sub-aggregation axis by term not working #10648

pemontto opened this issue Mar 2, 2017 · 9 comments · Fixed by #118338
Labels
blocked bug Fixes for quality problems that affect the customer experience Feature:ElasticCharts Issues related to the elastic-charts library Feature:Heatmap Heatmap visualization impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@pemontto
Copy link

pemontto commented Mar 2, 2017

Kibana version: 5.2.2

Elasticsearch version: 5.2.2

Browser version: Chrome, latest

Browser OS version: MacOS

Original install method (e.g. download page, yum, from source, etc.): download

Description of the problem including expected versus actual behavior: When ordering by terms the sub-bucket order isn't respected. I'm seeing the issue in both the heatmap and bar chart.

Steps to reproduce:

  1. Create a heatmap visualisation
  2. Add an X and Y axis aggregation and order by term
  3. Notice the sub-aggregations order isn't respected

Provide logs and/or server output (if relevant):
dayOfWeek sorted correctly, sub-aggregation hourOfDay incorrectly ordered:
screen shot 2017-03-02 at 09 38 44

hourOfDay sorted correctly, sub-aggregation dayOfWeek incorrectly ordered:
screen shot 2017-03-02 at 09 39 44

@thomasneirynck thomasneirynck added Feature:Heatmap Heatmap visualization Feature:Visualizations Generic visualization features (in case no more specific feature label is available) bug Fixes for quality problems that affect the customer experience labels Mar 2, 2017
@pemontto
Copy link
Author

pemontto commented Mar 4, 2017

OK testing out on different data this issue only occurs when the top level aggregation buckets return partial results. So for instance in the first screenshot 01-Monday didn't return data for hours 01, 02, 03, 10 etc. The first time 02 appears is in the 03-Wednesday bucket.

On indices where all days have some value for each hour the ordering works as expected.

This affects the vertical bar chart as well as the heatmap.

@pemontto
Copy link
Author

Just to clarify this isn't limited to the heatmap visualisation, partial buckets also have this effect on other charts.

@pemontto
Copy link
Author

@spalger we discussed this at Elasticon

@pemontto
Copy link
Author

Screenshot to follow

{
  "took": 5,
  "timed_out": false,
  "_shards": {
    "total": 15,
    "successful": 15,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 129,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "2": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "Critical",
                "doc_count": 1
              },
              {
                "key": "High",
                "doc_count": 1
              },
              {
                "key": "Low",
                "doc_count": 1
              },
              {
                "key": "Medium",
                "doc_count": 4
              }
            ]
          },
          "key": "A1 - Injection",
          "doc_count": 7
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "Medium",
                "doc_count": 1
              }
            ]
          },
          "key": "A10 - Unvalidated Redirects and Forwards",
          "doc_count": 1
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "Low",
                "doc_count": 13
              },
              {
                "key": "Medium",
                "doc_count": 3
              }
            ]
          },
          "key": "A2 - Broken Authentication and Session Management",
          "doc_count": 16
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "Medium",
                "doc_count": 4
              }
            ]
          },
          "key": "A3 - Cross-Site Scripting (XSS)",
          "doc_count": 4
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "Medium",
                "doc_count": 2
              }
            ]
          },
          "key": "A4 - Insecure Direct Object References",
          "doc_count": 2
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "High",
                "doc_count": 3
              },
              {
                "key": "Info",
                "doc_count": 3
              },
              {
                "key": "Low",
                "doc_count": 39
              },
              {
                "key": "Medium",
                "doc_count": 11
              }
            ]
          },
          "key": "A5 - Security Misconfiguration",
          "doc_count": 56
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "High",
                "doc_count": 1
              },
              {
                "key": "Low",
                "doc_count": 3
              },
              {
                "key": "Medium",
                "doc_count": 6
              }
            ]
          },
          "key": "A6 - Sensitive Data Exposure",
          "doc_count": 10
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "Critical",
                "doc_count": 1
              },
              {
                "key": "Info",
                "doc_count": 1
              },
              {
                "key": "Low",
                "doc_count": 3
              },
              {
                "key": "Medium",
                "doc_count": 8
              }
            ]
          },
          "key": "A7 - Missing Function Level Access Control",
          "doc_count": 13
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "Low",
                "doc_count": 1
              },
              {
                "key": "Medium",
                "doc_count": 1
              }
            ]
          },
          "key": "A8 - Cross-Site Request Forgery (CSRF)",
          "doc_count": 2
        },
        {
          "3": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": "High",
                "doc_count": 2
              },
              {
                "key": "Low",
                "doc_count": 7
              },
              {
                "key": "Medium",
                "doc_count": 4
              }
            ]
          },
          "key": "A9 - Using Components with Known Vulnerabilities",
          "doc_count": 13
        }
      ]
    }
  },
  "status": 200
}

@pemontto
Copy link
Author

pemontto commented Mar 1, 2018

Screenshot showing out of order X-axis
screen shot 2018-02-28 at 15 01 44

@timroes timroes added Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Sep 16, 2018
@dtungbmw
Copy link

dtungbmw commented Oct 8, 2018

any update on this?

@jpazsedano
Copy link

I'm using Elasticsearch and Kibana v6.4.2 and this still happens.

@stratoula stratoula added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Feature:ElasticCharts Issues related to the elastic-charts library labels Jul 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/datavis (Feature:ElasticCharts)

@flash1293
Copy link
Contributor

Blocked on #86184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Fixes for quality problems that affect the customer experience Feature:ElasticCharts Issues related to the elastic-charts library Feature:Heatmap Heatmap visualization impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants