I'm updating an application that used Elastic 1.6 to version 7.15. I've gotten indexing to work and some searching but for some reason filters aren't working. The queries are built dynamically and I think I've managed to translate the classes used to the new ones as needed.
When I inspect the elements in the SearchRequest object before executing the search it looks alright and looking at the reply (DebugInformation) the filter query looks alright, but the filter section logged by Elastic is missing field names. The query part is still correct.
Filter section as Nest/DebugInformation reports it:
"filter": [{
"bool": {
"must": [{
"bool": {
"must_not": [{
"range": {
"startPublish": {
"gte": "2021-11-26T11:28:41"
}
}
}
]
}
}, {
"bool": {
"must_not": [{
"range": {
"stopPublish": {
"lte": "2021-11-26T11:28:41"
}
}
}
]
}
}, {
"bool": {
"should": [{
"bool": {
"must_not": [{
"terms": {
"_type": ["EventPageIndexEntity"]
}
}
]
}
}, {
"range": {
"to": {
"gte": "2021-11-26T11:28:00",
"lt": "9999-12-31T23:59:59"
}
}
}
]
}
}, {
"terms": {
"acl": ["Intranet", "Everyone"]
}
}
]
}
}
]
Same section as Elastic logs it:
"filter": [{
"bool": {
"must": [{
"bool": {
"must_not": [{
"match_none": {
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}, {
"bool": {
"must_not": [{
"match_none": {
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}, {
"bool": {
"should": [{
"bool": {
"must_not": [{
"match_none": {
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}, {
"match_none": {
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}, {
"terms": {
"acl": ["Intranet", "Everyone"],
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}
]
The field names are gone, where does adjust_pure_negative and match_none come from and how can I make it work?