Hi
I need to run a search query across multiple indices (say, idx-users
and idx-meta
). The mapping for each is different.
idx-users
has a nested field (path: staysAt
, field: staysAt.street
), while idx-meta
doesn't have this field.
I'm trying to do a simple search (/idx-users,idx-meta/_search
), with function_score
query, in which one of the functions
is:
{
"filter": {
"nested": {
"path": "staysAt",
"query": {
"term": {
"staysAt.street": "MGRoad"
}
}
}
},
"weight": 1.5
}
Upon running this query, I'm facing the following error:
{
"index": "idx-meta",
"caused_by": {
"type": "illegal_state_exception",
"reason": "[nested] failed to find nested object under path [staysAt]"
}
}
How can I successfully run my query, and have scores according to whichever filter functions match?
Elasticsearch: v7.0.0