Describe the bug
We've tried to update our plugin to build on the 3.3 snapshots, but this causes integration test failures as doing two rounds of must_not(must_not(cond)) now matches not-cond, instead of cond. ref: opensearch-project/sql#4264
Related component
Search
To Reproduce
- Create an index with at least 2 different terms:
PUT /entity-a-idx
{
"settings": {
"index": {
"number_of_shards": 2,
"number_of_replicas": 1
}
},
"mappings": {
"properties": {
"product": {
"type": "text"
}
}
}
}
POST entity-a-idx/_create/1
{
"product": "Apples"
}
POST entity-a-idx/_create/2
{
"product": "Oranges"
}
- Attempt to query with double-negation:
POST entity-a-idx/_search
{
"query": {
"bool": {
"must_not": [
{
"bool": {
"must_not": {
"match": {
"product": "Oranges"
}
}
}
}
]
}
}
}
- On 3.2, this returns:
{
// ...
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 0,
"hits": [
{
"_index": "entity-a-idx",
"_id": "2",
"_score": 0,
"_source": {
"product": "Oranges"
}
}
]
}
}
While on the latest 3.3 snapshot, this returns:
{
// ...
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 0,
"hits": [
{
"_index": "entity-a-idx",
"_id": "1",
"_score": 0,
"_source": {
"product": "Apples"
}
}
]
}
}
Expected behavior
not(not(x)) should be equivalent to x. While this specific case is a little frivolous, it comes up enough in code generation, and it might indicate breakage for expressions that aren't as easily rewritten by hand.
Additional Details
Plugins
SQL & friends, but they're not used for the repro.
Screenshots
N/A
Host/Environment (please complete the following information):
- OS: Linux 5.10, x86_64
- OpenJDK 21
Additional context
N/A
Describe the bug
We've tried to update our plugin to build on the 3.3 snapshots, but this causes integration test failures as doing two rounds of
must_not(must_not(cond))now matches not-cond, instead ofcond. ref: opensearch-project/sql#4264Related component
Search
To Reproduce
While on the latest 3.3 snapshot, this returns:
Expected behavior
not(not(x))should be equivalent tox. While this specific case is a little frivolous, it comes up enough in code generation, and it might indicate breakage for expressions that aren't as easily rewritten by hand.Additional Details
Plugins
SQL & friends, but they're not used for the repro.
Screenshots
N/A
Host/Environment (please complete the following information):
Additional context
N/A