I have a problem. Halp me please.
See the queries below
created new index with custom analyzer
PUT test
{
"mappings": {
"test": {
"_all": {
"analyzer": "testAnalyzer"
},
"properties": {
"name": {
"type": "string",
"analyzer": "testAnalyzer"
}
}
}
},
"settings": {
"analysis": {
"filter": {
"testsyn": {
"type": "synonym",
"synonyms": [
"test test => test_test"
]
}
},
"analyzer": {
"testAnalyzer": {
"filter": [
"lowercase",
"testsyn"
],
"type": "custom",
"tokenizer": "standard"
}
}
}
}
}
Add data to index
PUT test/test/1
{
"name": "test"
}
PUT test/test/2
{
"name": "test test"
}
Check data and custom analyzer
POST test/test/_search
{
"query": {
"match_all": {}
}
}
GET test/_analyze?analyzer=testAnalyzer&text=test test
Check query_string, we can view that custom analyzer not use
POST test/test/_search
{
"explain": true,
"query": {
"query_string": {
"default_field": "name",
"query": "test test"
}
}
}
Why? What can I do to fix this?
Thanks