Created
September 5, 2011 14:29
-
-
Save anonymous/1195120 to your computer and use it in GitHub Desktop.
This file contains hidden or 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_index?pretty; | |
| { | |
| "ok" : true, | |
| "acknowledged" : true | |
| } | |
| curl -XPOST localhost:9200/test_index?pretty -d '{ | |
| "analysis": { | |
| "analyzer": { | |
| "my_analyzer": { | |
| "type": "standard", | |
| "stopwords": [ "something" ] | |
| } | |
| } | |
| } | |
| }'; | |
| { | |
| "ok" : true, | |
| "acknowledged" : true | |
| } | |
| curl -XGET 'localhost:9200/test_index/_analyze?analyzer=my_analyzer&pretty' -d '{"the times"}'; | |
| { | |
| "tokens" : [ { | |
| "token" : "the", | |
| "start_offset" : 2, | |
| "end_offset" : 5, | |
| "type" : "<ALPHANUM>", | |
| "position" : 1 | |
| }, { | |
| "token" : "times", | |
| "start_offset" : 6, | |
| "end_offset" : 11, | |
| "type" : "<ALPHANUM>", | |
| "position" : 2 | |
| } ] | |
| } | |
| ---- now with no analyzer | |
| curl -XDELETE localhost:9200/test_index?pretty; | |
| { | |
| "ok" : true, | |
| "acknowledged" : true | |
| } | |
| curl -XPOST localhost:9200/test_index?pretty -d '{ | |
| "analysis": { | |
| "analyzer": { | |
| "my_analyzer": { | |
| "type": "standard", | |
| "stopwords": [ ] | |
| } | |
| } | |
| } | |
| }'; | |
| { | |
| "ok" : true, | |
| "acknowledged" : true | |
| } | |
| curl -XGET 'localhost:9200/test_index/_analyze?analyzer=my_analyzer&pretty' -d '{"the times"}'; | |
| { | |
| "tokens" : [ { | |
| "token" : "times", | |
| "start_offset" : 6, | |
| "end_offset" : 11, | |
| "type" : "<ALPHANUM>", | |
| "position" : 2 | |
| } ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment