Hi,
I have an elastic query where I would like to filter on the property userData where the windowsId = 'palkema', so I can retrieve those through the inner_hits response, however this is impacting my overall result.
For example, the first part of this query is looking for the word Test in the ProductName field, which may return say.. 10 results.
The second part is returning any result where the userData.windowsId = palkema, but what I want, is basically to not filter by that as a whole, just filter the sub property. So if I have 100 records where userData.windowsId = palkema, I get a potential of 110 records, but I only want the 10 records that match the query string lookup, and for those that don't have the match for the windowsId, I just want nulls in the inner_hits property.
Is this possible?
"query": {
"bool": {
"should": [
{
"multi_match": {
"query": "Test",
"fields": [
"productName^1"
],
"type": "best_fields",
"operator": "and"
}
},
{
"nested": {
"path": "userData",
"query": {
"bool": {
"should": [
{
"term": {
"userData.windowsId": "palkema"
}
}
]
}
},
"inner_hits": {},
}
}
]
}
}