elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.03k stars 24.83k forks source link

Analysis: Phonetic filter `replace` flag is inverted, fix (changes default behavior now, to follow docs) #1127

Closed clintongormley closed 13 years ago

clintongormley commented 13 years ago
curl -XPUT 'http://127.0.0.1:9200/foo/?pretty=1'  -d '
{
   "settings" : {
      "analysis" : {
         "filter" : {
            "name_metaphone" : {
               "replace" : false,
               "encoder" : "metaphone",
               "type" : "phonetic"
            }
         },
         "analyzer" : {
            "my_analyzer" : {
               "filter" : [
                  "standard",
                  "name_metaphone"
               ],
               "type" : "custom",
               "tokenizer" : "standard"
            }
         }
      }
   }
}
'

curl -XGET 'http://127.0.0.1:9200/foo/_analyze?pretty=1&text=robert&analyzer=my_analyzer' 

# [Mon Jul 18 12:30:23 2011] Response:
# {
#    "tokens" : [
#       {
#          "end_offset" : 6,
#          "position" : 1,
#          "start_offset" : 0,
#          "type" : "<ALPHANUM>",
#          "token" : "RBRT"
#       }
#    ]
# }
kimchy commented 13 years ago

The flag setting is inverted, will fix it...