Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kibana does not search on nested field

working with Elasticsearch/Kibana and trying to search on field in a nested object. However it does not seem to work. Here's mapping that I use in a template:

{
  "order": 0,
  "template": "ss7_signaling*",
  "settings": {
    "index": {
      "mapping.total_fields.limit": 3000,
      "number_of_shards": "5",
      "refresh_interval": "30s"
  },
  "mappings": {
    "_default_": {
      "dynamic_templates": [
        {
          "string_fields": {
            "mapping": {
              "fielddata": {
                "format": "disabled"
              },
              "index": "no",
              "type": "string"
            },
            "match_mapping_type": "string",
            "match": "*"
          }
        }
      ],
      "properties": {
        "message": {
          "index": "not_analyzed",
          "type": "string"
        },
        "Protocol": {
          "index": "not_analyzed",
          "type": "string"
        },
        "IMSI": {
          "index": "not_analyzed",
          "type": "string"
        },
        "nested": {
            "type": "nested",
            "properties": {
                "name": {
                    "type": "string",
                    "index": "not_analyzed"
                }
            }
        },
        "Timestamp": {
          "format": "strict_date_optional_time||epoch_millis",
          "type": "date"
        },
        "@timestamp": {
          "type": "date"
        },
        "@version": {
          "index": "not_analyzed",
          "type": "string"
        }
      },
      "_all": {
        "norms": false,
        "enabled": false
      }
    }
  },
  "aliases": {
    "signaling": {}
  }
}

When I do search kibana on single fields - everything works fine. Still though i cannot search on nested fields like 'nested.name'.

Example of my query in kibana: nested.name:hi

Thanks.

like image 329
Alex Shevchenko Avatar asked Jan 23 '18 09:01

Alex Shevchenko


1 Answers

Kibana uses the query_string query underneath, and the latter does not support querying on nested fields.

It's still being worked on but in the meantime you need to proceed differently.

UPDATE:

As of ES 7.6, it is now possible to search on nested fields

like image 93
Val Avatar answered Oct 16 '22 11:10

Val