Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
opensearch version 2.17
Describe the issue:
PPL query on nested fields always returns zero records
Configuration:
PUT /patients
{
“mappings”: {
“properties”: {
“patient”: {
“properties”: {
“name”: {
“type”: “text”
},
“id”: {
“type”: “integer”
},
“contacts”: {
“type”: “nested”,
“properties”: {
“name”: {
“type”: “keyword”
},
“relationship”: {
“type”: “keyword”
},
“phone”: {
“type”: “keyword”
}
}
},
“associations”: {
“properties”: {
“job”: {
“type”: “keyword”
},
“title”: {
“type”: “keyword”
},
“email”: {
“type”: “keyword”
}
}
}
}
}
}
}
}
Sample Document
PUT /patients/_doc/1
{
“patient”: {
“name”: “John Doe”,
“id”: 1,
“contacts”: [
{
“name”: “Jane Doe”,
“relationship”: “mother”,
“phone”: “5551111”
},
{
“name”: “Joe Doe”,
“relationship”: “father”,
“phone”: “5552222”
}
],
“associations”: {
“job”: “it”,
“title”: “developer”,
“email”: “doe@gmail.com”
}
}
}
Working query
source = patients | where patient.associations.email = ‘doe@gmail.com’
Not working on nested fields
source = patients | where patient.contacts.name = ‘Jane Doe’
Relevant Logs or Screenshots:
Always returns zero records
Tested on query workbench with ppl mode