Hi, I'm trying to search with analysis-phonetic plugin and cannot get matching results. Please help!
I've installed plugin, and took example from documentation
PUT /phonetic_sample
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"my_metaphone"
]
}
},
"filter": {
"my_metaphone": {
"type": "phonetic",
"encoder": "metaphone",
"replace": false
}
}
}
}
}
}
GET /phonetic_sample/_analyze is working fine
{
"analyzer": "my_analyzer",
"text": "lopez"
}
Output
{
"tokens": [
{
"token": "LPS",
"start_offset": 0,
"end_offset": 5,
"type": "<ALPHANUM>",
"position": 0
},
{
"token": "lopez",
"start_offset": 0,
"end_offset": 5,
"type": "<ALPHANUM>",
"position": 0
}
]
}
Added a document
PUT /phonetic_sample/_doc/1
{"firstname": "cindy",
"lastname": "lopes"
}
Search return is empty
GET /phonetic_sample/_doc/_search
"query": {
"match": {
"lastname": {
"query": "lopez",
"analyzer": "my_analyzer"
}
}
}
}
Please let me know what is wrong?