Can I create a query with only filter context in it, without any query context or do I always have to have some query context in addition to the filter?
In addition I'd like it to be nested, but let me know if I can have filter without nested as well if combination of filter and nested is not possible.
May be use filtered?
The idea is that I don't need scoring, just a quick filter over the documents.
An example would for the query itself would be something like this:
{
"query": {
"nested": {
"path": "properties",
"filter": {
"bool": {
"must": [
{
"term": {
"properties.key": "propertyName"
}
},
{
"term": {
"properties.value": "propertyValue"
}
}
]
}
}
}
}
}
The above doesn't work, while the one below does work:
{
"query": {
"nested": {
"path": "properties",
"query": {
"bool": {
"must": [
{
"match": {
"properties.key": "propertyName"
}
},
{
"match": {
"properties.value": "propertyValue"
}
}
]
}
}
}
}
}