Hi there, I'm trying to understand, why search within root and nested objects works in ES 1.7 and now it dosn't work in ES 7.13. May be I'm missing something? I use the following index mapping and search requests:
ES 1.7 index mapping
{
"test_index": {
"aliases": {},
"mappings": {
"doc": {
"properties": {
"nested_field": {
"properties": {
"nested_field_one": {
"type": "string"
}
}
},
"root_field_one": {
"type": "string"
}
}
},
"objects": {
"properties": {
"nested_field": {
"type": "nested",
"properties": {
"nested_field_one": {
"type": "string",
"fields": {
"raw": {
"type": "string"
}
}
}
}
},
"root_field_one": {
"type": "string",
"fields": {
"raw": {
"type": "string"
}
}
}
}
}
},
"settings": {
"index": {
"creation_date": "1624954705360",
"number_of_shards": "5",
"number_of_replicas": "1",
"version": {
"created": "1070699"
},
"uuid": "HcpzYGoJTbas9j3-PVWdsA"
}
},
"warmers": {}
}
}
Search request:
POST test_index/_search
{
"query": {
"query_string": {
"query": "root AND nested"
}
},
"size": 10,
"from": 0,
"sort": []
}
Response:
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.16273327,
"hits": [
{
"_index": "test_index",
"_type": "doc",
"_id": "1",
"_score": 0.16273327,
"_source": {
"nested_field": [
{
"nested_field_one": "nested field text"
}
],
"root_field_one": "root field text"
}
}
]
}
}
ES 7.13 index mapping
{
"test_index": {
"aliases": {},
"mappings": {
"properties": {
"nested_field": {
"type": "nested",
"properties": {
"nested_field_one": {
"type": "text",
"fields": {
"raw": {
"type": "text"
}
}
}
}
},
"root_field_one": {
"type": "text",
"fields": {
"raw": {
"type": "text"
}
}
}
}
},
"settings": {
"index": {
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_content"
}
}
},
"number_of_shards": "1",
"provided_name": "test_index",
"creation_date": "1624956038877",
"number_of_replicas": "1",
"uuid": "IEP4vqxtT06QvuXBWxly0A",
"version": {
"created": "7130199"
}
}
}
}
}
Search request:
POST test_index/_search
{
"query": {
"query_string": {
"query": "root AND nested"
}
},
"size": 10,
"from": 0,
"sort": []
}
Response:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"max_score": null,
"hits": []
}
}