OpenSearch
OpenSearch copied to clipboard
[BUG] wildcard query returns nothing incorrectly when the pattern value contains capital letter
Describe the bug
This search query works
GET opensearch_dashboards_sample_data_ecommerce/_search
{
"from": 0,
"size": 200,
"query": {
"bool": {
"filter": [
{
"bool": {
"must": [
{
"wildcard": {
"manufacturer": {
"value": "tigress*",
"boost": 1
}
}
}
],
"boost": 1
}
}
],
"boost": 1
}
},
"_source": {
"includes": [
"manufacturer"
],
"excludes": []
}
}
But if we change the value to Tigress* (even the real text is Tigress), it return nothing:
GET opensearch_dashboards_sample_data_ecommerce/_search
{
"from": 0,
"size": 200,
"query": {
"bool": {
"filter": [
{
"bool": {
"must": [
{
"wildcard": {
"manufacturer": {
"value": "Tigress*",
"boost": 1
}
}
}
],
"boost": 1
}
}
],
"boost": 1
}
},
"_source": {
"includes": [
"manufacturer"
],
"excludes": []
}
}
Related component
Search
To Reproduce
- Go to playground dev tool
- Try above two queries.
Expected behavior
Return matched docs.
Additional Details
Plugins Please list all plugins currently enabled.
Screenshots If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
- OS: [e.g. iOS]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
Want to try to write a (failing) YAML REST test?
https://github.com/opensearch-project/OpenSearch/blob/main/TESTING.md#testing-the-rest-layer
@LantaoJin can you describe manufacturer field type?
You can use the case_insensitive parameter
GET opensearch_dashboards_sample_data_ecommerce/_search
{
"from": 0,
"size": 200,
"query": {
"bool": {
"filter": [
{
"bool": {
"must": [
{
"wildcard": {
"manufacturer": {
"value": "Tigress*",
"boost": 1,
"case_insensitive": true
}
}
}
],
"boost": 1
}
}
],
"boost": 1
}
},
"_source": {
"includes": [
"manufacturer"
],
"excludes": []
}
}