When querying on a property that does not exist in ES 6.4 I notice that documents are returned despite the fact it is not in the mappings. See the below example. The name property exists however aklsdfkljasdf does not exist in the mappings. The query below will return any document matching with a name of user-login and it acts like the aklsdfkljasdf portion of the query is not evaluated.
I would expect this to return no results as the property does not exist. Looking for some assistance to understand why this is the case.
POST /myindexname/_search
{
"version": true,
"size": 500,
"_source": {
"excludes": []
},
"stored_fields": [
"*"
],
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "+name:(\"user-login\") +aklsdfkljasdf:(\"asdf\")",
"analyze_wildcard": true,
"default_field": "*"
}
}
]
}
}
}
Results