Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Fixed
- Harden the circuit breaker and failure handle logic in query result consumer ([#19396](https://github.com/opensearch-project/OpenSearch/pull/19396))
- Fix case insensitive and escaped query on wildcard ([#16827](https://github.com/opensearch-project/OpenSearch/pull/16827))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ setup:
id: 7
body:
my_field: "ABCD"
- do:
index:
index: test
id: 8
body:
my_field: "*"

- do:
index:
index: test
id: 9
body:
my_field: "\\*"
- do:
indices.refresh: {}

Expand Down Expand Up @@ -223,7 +236,7 @@ setup:
wildcard:
my_field:
value: "*"
- match: { hits.total.value: 6 }
- match: { hits.total.value: 8 }
---
"regexp match-all works":
- do:
Expand All @@ -234,7 +247,7 @@ setup:
regexp:
my_field:
value: ".*"
- match: { hits.total.value: 6 }
- match: { hits.total.value: 8 }
---
"terms query on wildcard field matches":
- do:
Expand Down Expand Up @@ -270,3 +283,113 @@ setup:
- match: { hits.total.value: 2 }
- match: { hits.hits.0._id: "5" }
- match: { hits.hits.1._id: "7" }
---
"case insensitive regexp query on wildcard field":
- do:
search:
index: test
body:
query:
regexp:
my_field:
value: "AbCd"
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "5" }
- do:
search:
index: test
body:
query:
regexp:
my_field:
value: "AbCd"
case_insensitive: true
- match: { hits.total.value: 2 }
- match: { hits.hits.0._id: "5" }
- match: { hits.hits.1._id: "7" }
---
"wildcard query works on values contains escaped characters":
- do:
search:
index: test
body:
query:
wildcard:
my_field:
value: "\\*"
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "8" }

- do:
search:
index: test
body:
query:
wildcard:
my_field:
value: "\\\\\\*"
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "9" }
---
"regexp query works on values contains escaped characters":
- do:
search:
index: test
body:
query:
regexp:
my_field:
value: "\\*"
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "8" }

- do:
search:
index: test
body:
query:
regexp:
my_field:
value: "\\\\\\*"
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "9"}
---
"term query contains escaped characters":
- do:
search:
index: test
body:
query:
term:
my_field: "\\*"
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "9" }

- do:
search:
index: test
body:
query:
term:
my_field: "*"
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "8"}
---
"terms query contains escaped characters":
- do:
search:
index: test
body:
query:
terms: { my_field: ["*"] }
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "8" }

- do:
search:
index: test
body:
query:
terms: { my_field: [ "\\*" ] }
- match: { hits.total.value: 1 }
- match: { hits.hits.0._id: "9" }
Loading
Loading