Hi everyone!
Could you please help me on how to use query_string with * and escaped characters?
For example:
Mapping:
{
"index": "test_user_name",
"mappings": {
"properties": {
"userId": {
"type": "keyword"
},
"name": {
"type": "text"
}
}
}
}
Record that is stored in index:
{"userId": "1", "name": "AliceV!ABC"}
Query:
{
"query": {
"query_string": {
"query": "*Alice* AND *V\\!*",
"default_field": "name"
}
}
}
Expected result: stored record is returned.
Actual result: record is not returned.
Note: without special chars everything works correct.
Following query (without escaped char returns expected result):
{
"query": {
"query_string": {
"query": "*Alice* AND *V*",
"default_field": "name"
}
}
}
Thanks in advance, Nick.