Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sasidevtool opened this issue Mar 10, 2025 · 0 comments
Open

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

sasidevtool opened this issue Mar 10, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@sasidevtool
Copy link

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
@sasidevtool sasidevtool added bug Something isn't working untriaged labels Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants