Let's say I have users indexed with documents such as these:
{
"name": "Fred Jonsson",
"age": 24,
"emails": [
{
"active": false,
"address": "[email protected]",
},
{
"active": false,
"address": "[email protected]",
},
{
"active": true,
"address": "[email protected]",
},
{
"active": false,
"address": "[email protected]",
},
}
}
Does the ElasticSearch DSL allow me to construct a query where I could search for people by their e-mail address, but only if the address is active? In more abstract terms, search documents by nested objects conditioned on other properties of those objects.
A search fulfilling this criterion would return this document for a search for "[email protected]"
or "engineeringcorp.com"
, but would not return this document when searching for "[email protected]"
.