Created
May 15, 2011 04:00
-
-
Save crx/972878 to your computer and use it in GitHub Desktop.
asciifolding behavior in ElasticSearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/elasticsearch.yml | |
index: | |
analysis: | |
analyzer: | |
default: | |
tokenizer: standard | |
filter: ["standard", "lowercase", "stop", "asciifolding"] | |
curl -XPUT localhost:9200/test | |
# {"ok":true,"acknowledged":true} | |
curl -XPUT localhost:9200/test/person/1 -d '{"name":"Cameron Díaz"}' | |
# {"ok":true,"_index":"test","_type":"person","_id":"1","_version":1} | |
curl -XPUT localhost:9200/test/person/2 -d '{"name":"Juan Diaz"}' | |
# {"ok":true,"_index":"test","_type":"person","_id":"2","_version":1} | |
curl -XGET "localhost:9200/test/person/_search?q=diaz&pretty" | |
# { | |
# ... omitted ... | |
# | |
# "hits" : { | |
# "total" : 2, | |
# "max_score" : 0.13561106, | |
# "hits" : [ { | |
# "_index" : "test", | |
# "_type" : "person", | |
# "_id" : "1", | |
# "_score" : 0.13561106, "_source" : {"name":"Cameron Díaz"} | |
# }, { | |
# "_index" : "test", | |
# "_type" : "person", | |
# "_id" : "2", | |
# "_score" : 0.13561106, "_source" : {"name":"Juan Diaz"} | |
# } ] | |
# } | |
# } | |
curl -XGET "localhost:9200/test/person/_search?q=díaz&pretty" | |
# { | |
# ... omitted ... | |
# | |
# "hits" : { | |
# "total" : 0, | |
# "max_score" : null, | |
# "hits" : [ ] | |
# } | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment