-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Tested using clean docker 7.12.1
version: Version: 7.12.1, Build: default/docker/3186837139b9c6b6d23c3200870651f10d3343b7/2021-04-20T20:56:39.040728659Z, JVM: 16
on
Linux 0ca876ff72e4 4.19.121-linuxkit #1 SMP Thu Jan 21 15:36:34 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
When using a trim normalizer in combination of a keyword wildcard search, the search fails at the end or beginning of words when using a single wildcard. In those situations you need to add a double wild card.
Steps to reproduce:
- Create index
PUT /test-normalizer-index
{
"settings": {
"analysis": {
"normalizer": {
"trimming_normalizer": {
"filter": [
"trim"
]
}
}
}
},
"mappings": {
"properties": {
"name": {
"type": "keyword",
"normalizer": "trimming_normalizer"
}
}
}
}
- Add doc to index
POST /test-normalizer-index/_doc/
{
"name": "elastic search"
}
- Search for an entry that would expect to get a result
GET /test-normalizer-index/_search
{
"query": {
"wildcard": {
"name": {
"value": "elasti? search"
}
}
}
}
this provides 0 results
These are some other tests results:
elast?c search -> finds a document - EXPECTED
elastic searc? -> finds a document - EXPECTED
?lastic search -> finds a document - EXPECTED
elastic ?earch -> fails to find a document - UNEXPECTED
elastic ??earch -> finds a document - UNEXPECTED
elasti? search -> fails to find a document - UNEXPECTED
elasti?? search -> finds a document - UNEXPECTED
The first three tests are as expected. The last 4 tests seem incorrect.