-
-
Save imotov/b525c0f0e96139bfdfab to your computer and use it in GitHub Desktop.
German stop words
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
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