Skip to content

Instantly share code, notes, and snippets.

@kireet
Created February 14, 2014 17:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kireet/9005493 to your computer and use it in GitHub Desktop.
icu analysis/stopwords issue
result=`curl -s -XDELETE 'http://localhost:9200/test?pretty=true'`
echo "$result"
echo "attempting index creation"
result=`curl -s -XPOST 'http://localhost:9200/test?pretty=true' -d '{
"index" : {
"analysis" : {
"analyzer" : {
"_fr" : {
"type": "custom",
"tokenizer": "icu_tokenizer",
"filter": ["icu_folding", "icu_normalizer", "fr_stop_filter", "fr_stem_filter"]
},
"_fr2" : {
"type": "custom",
"tokenizer": "icu_tokenizer",
"filter": ["icu_normalizer", "fr_stop_filter", "fr_stem_filter"]
},
"default": {
"type": "custom",
"tokenizer": "icu_tokenizer",
"filter": ["icu_folding", "icu_normalizer"]
}
},
"filter" : {
"fr_stop_filter": {
"type": "stop",
"stopwords": ["_french_"]
},
"fr_stem_filter": {
"type": "stemmer",
"name": "light_french"
}
}
}
}
}'`
echo $result
result=`curl -s "http://localhost:9200/_analyze?analyzer=french&pretty=true&text=M%C3%AAme"`
echo 'french analyzer: ' $result
result=`curl -s "http://localhost:9200/test/_analyze?analyzer=_fr&pretty=true&text=M%C3%AAme"`
echo 'folding/normalizing analyzer' $result
result=`curl -s "http://localhost:9200/test/_analyze?analyzer=_fr2&pretty=true&text=M%C3%AAme"`
echo 'normalizing analyzer' $result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment