Last active
December 20, 2015 14:49
-
-
Save jl982/6149763 to your computer and use it in GitHub Desktop.
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
# Remove old data | |
curl -XDELETE localhost:9200/test | |
# Insert single document into a non-existing index | |
curl -XPOST localhost:9200/test/post -d '{ "content" : "drawing" }' | |
# Add kstem token filter | |
curl -XPOST localhost:9200/test/_close | |
curl -XPUT http://localhost:9200/test/_settings -d '{ | |
"settings":{ | |
"analysis":{ | |
"analyzer":{ | |
"default":{ | |
"type":"custom", | |
"tokenizer":"standard", | |
"filter":[ "standard", "kstem" ] | |
} | |
} | |
} | |
} | |
}' | |
curl -XPOST localhost:9200/test/_open | |
# "drawing" returns result, but "draw" doesn't | |
curl localhost:9200/test/_search?q=drawing | |
curl localhost:9200/test/_search?q=draw | |
# Change kstem to porter_stem token filter | |
curl -XPOST localhost:9200/test/_close | |
curl -XPUT http://localhost:9200/test/_settings -d '{ | |
"settings":{ | |
"analysis":{ | |
"analyzer":{ | |
"default":{ | |
"type":"custom", | |
"tokenizer":"standard", | |
"filter":[ "standard", "porter_stem" ] | |
} | |
} | |
} | |
} | |
}' | |
curl -XPOST localhost:9200/test/_open | |
# Neither "drawing" nor "draw" returns result | |
curl localhost:9200/test/_search?q=drawing | |
curl localhost:9200/test/_search?q=draw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment