Skip to content

Instantly share code, notes, and snippets.

@imotov
Created November 14, 2012 16:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save imotov/b525c0f0e96139bfdfab to your computer and use it in GitHub Desktop.
Save imotov/b525c0f0e96139bfdfab to your computer and use it in GitHub Desktop.
German stop words
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"settings": {
"index" : {
"analysis" : {
"analyzer" : {
"my_analyzer" : {
"type" : "custom",
"tokenizer" : "standard",
"filter": ["standard", "lowercase", "my_synonym", "my_stop"]
}
},
"filter" : {
"my_synonym" : {
"type" : "synonym",
"synonyms" : [
"malerin => maler",
"lackierer => lackier"
]
},
"my_stop" : {
"type" : "stop",
"stopwords" : ["_german_","additional_word"]
}
}
}
}
},
"mappings": {
"doc": {
"properties": {
"job": {"type": "string", "analyzer": "my_analyzer" }
}
}
}
}'
echo
curl -XPUT localhost:9200/test/doc/1 -d '{"job": "Maler und Lackierer"}'
echo
curl -XPUT localhost:9200/test/doc/2 -d '{"job": "Malerin und Lackiererin"}'
echo
curl -XPOST localhost:9200/test/_refresh
echo
curl -XPOST "localhost:9200/test/_search?q=job:maler&pretty=true"
echo
curl -XPOST "localhost:9200/test/_search?q=job:malerin&pretty=true"
echo
curl -XPOST "localhost:9200/test/_search?q=job:und&pretty=true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment