Here are steps to repro on 6.2.2
# verify elastic endpoint is up with version 6.2.2
curl localhost:9200
# create myindex with mapping
curl -H 'Content-Type: application/json' -XPUT -d '{ "mappings": { "configs": { "properties": { "Kind": { "type": "keyword" }, "meta": { "type": "nested", "properties": { "Name": { "type": "text" }, "Tenant": { "type": "keyword" } } } } } } }' http://localhost:9200/myindex
# verify mapping
curl localhost:9200/myindex/_mapping?pretty
# add doc/object
curl -H 'Content-Type: application/json' -d '{ "Kind": "foo", "meta": { "Name": "sg03", "Tenant": "audi" } }' http://localhost:9200/myindex/configs
# verify object
curl localhost:9200/myindex/_search?pretty
# text search on outer field (Kind's) value
curl localhost:9200/myindex/_search?q=foo
# text search on nested field (Tenant's) value
curl localhost:9200/myindex/_search?q=audi
Here is my repro with output shown ...
MacBook-Pro[search] $ curl localhost:9200
{
"name" : "iP_9TW_",
"cluster_name" : "test-elasticcluster",
"cluster_uuid" : "HtH7CfY0Sd6QxoAtBaxVUA",
"version" : {
"number" : "6.2.2",
"build_hash" : "10b1edd",
"build_date" : "2018-02-16T19:01:30.685723Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
MacBook-Pro[search] $ curl -H 'Content-Type: application/json' -XPUT -d '{ "mappings": { "configs": { "properties": { "Kind": { "type": "keyword" }, "meta": { "type": "nested", "properties": { "Name": { "type": "text" }, "Tenant": { "type": "keyword" } } } } } } }' http://localhost:9200/myindex
{"acknowledged":true,"shards_acknowledged":true,"index":"myindex"}
MacBook-Pro[search] $ curl localhost:9200/myindex/_mapping?pretty
{
"myindex" : {
"mappings" : {
"configs" : {
"properties" : {
"Kind" : {
"type" : "keyword"
},
"meta" : {
"type" : "nested",
"properties" : {
"Name" : {
"type" : "text"
},
"Tenant" : {
"type" : "keyword"
}
}
}
}
}
}
}
}
MacBook-Pro[search] $ curl -H 'Content-Type: application/json' -d '{ "Kind": "foo", "meta": { "Name": "sg03", "Tenant": "audi" } }' http://localhost:9200/myindex/configs
{"_index":"myindex","_type":"configs","_id":"KpGcIGIBHBDa29EzJsNU","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1}
MacBook-Pro[search] $ curl localhost:9200/myindex/_search?pretty
{
"took" : 85,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [
{
"_index" : "myindex",
"_type" : "configs",
"_id" : "KpGcIGIBHBDa29EzJsNU",
"_score" : 1.0,
"_source" : {
"Kind" : "foo",
"meta" : {
"Name" : "sg03",
"Tenant" : "audi"
}
}
}
]
}
}
## Text search on outer field - HIT/WORKS
MacBook-Pro[search] $ curl localhost:9200/myindex/_search?q=foo
{"took":18,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":1,"max_score":0.2876821,"hits":[{"_index":"myindex","_type":"configs","_id":"KpGcIGIBHBDa29EzJsNU","_score":0.2876821,"_source":{ "Kind": "foo", "meta": { "Name": "sg03", "Tenant": "audi" } }}]}}
## Text search on inner field - MISS
MacBook-Pro[search] $ curl localhost:9200/myindex/_search?q=audi
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}