ppadovani / KibanaNestedSupportPlugin

A plugin for Kibana 5.5 and beyond that adds support for nested field search and aggregation.
https://ppadovani.github.io/knql_plugin/overview/
Apache License 2.0
79 stars 7 forks source link

Aggregation filter #82

Closed cyberjeff-u8t closed 6 years ago

cyberjeff-u8t commented 6 years ago

Plugin version: nested-fields-support-6.2.4-1.0.4.zip

Kibana version: kibana-6.2.4-linux-x86_64/

Plugins installed: nested-fields-support-6.2.4-1.0.4.zip

Description of the problem including expected versus actual behavior:

Steps to reproduce:

  1. Create index

    PUT test_cars { "mappings": { "_doc": { "properties": { "cars": { "type": "nested" } } } } }

  2. Put some data

POST test_cars/_doc { "cars":[ { "make": "Fiat", "color": "blue", "type:": "Penda" }, { "make": "Fiat", "color": "blue", "type:": "Punto" } ]
}

etc... etc....

  1. Create visualization Pie chart in Kibana: buckets:
    • Split Chart: Terms field cars.make.keyword
    • Split Slices: Terms field cars.type.keyword

Now the issue is that I'm not able to filter cars by make:

-I tried in search bar: cars.make.keyword = 'Fiat'

The elasticsearch query with filter terms is working: "cars.make.keyword": ["Fiat"] How can we reproduce this filtering in kibana?

GET test_cars/_search { "size": 0, "query": { "match_all": {}

 },
 "_source": {
   "excludes": []
 },
 "aggs": {
   "nested_2": {
     "nested": {
       "path": "cars"
     },
     "aggs": {
        "inner": {
          "filter": {
            "terms": {
              "cars.make.keyword": ["Fiat"]
            }
          },
          "aggs": {
            "2": {
              "terms": {
                "field": "cars.make.keyword",
                "size": 5,
                "order": {
                  "_count": "desc"
                }
              },
              "aggs": {
                "3": {
                 "terms": {
                   "field": "cars.type.keyword",
                   "size": 5,
                   "order": {
                     "_count": "desc"
                   }
                 }
                }
              }
           }
          }
        }
     }
   }
 }

}

ppadovani commented 6 years ago

I'm fairly sure was working before... I'll take a look as soon as I finish the port to 6.3.

ppadovani commented 6 years ago

Took a look at this in the 6.3 port I'm close to releasing. It seems to work fine. I should be able to take a look at this this weekend at your release level.

ppadovani commented 6 years ago

Ok... I have finished porting all of the fixes except this issue. I was unable to duplicate this issue based on your description. I used the test scripts in this project to create the index, and populate the data. Then I created a pie chart visualization with two metrics, and in the search bar was able to add a cars.make="Honda" and have it filter the data.

Can you please retest, and if you are still having this issue, try and provide additional details?

Thanks!

ppadovani commented 6 years ago

Please reopen if this is still an issue.