Skip to content

[BUG]PPL query doesn't work on nested fields #534

Open
@sasidevtool

Description

@sasidevtool

What is the bug?
Returns 0 records when using PPL query on nested fields

How can one reproduce the bug?

Example Mapping
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": "[email protected]"
}
}
}

Working query
source = patients | where patient.associations.email = '[email protected]'

Not working on nested fields
source = patients | where patient.contacts.name = 'Jane Doe'

What is the expected behavior?
Expected to return all records whose contacts name is Jane Doe

What is your host/environment?

  • opensearch query workbench
  • opensearch version 2.17

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions