Created
March 15, 2011 13:31
-
-
Save bdargan/870714 to your computer and use it in GitHub Desktop.
Elastic Search snowball Sample
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/twitter | |
curl -XPOST localhost:9200/twitter -d ' | |
{"index": | |
{ "number_of_shards": 1, | |
"analysis": { | |
"filter": { | |
"snowball": { | |
"type" : "snowball", | |
"language" : "English" | |
} | |
}, | |
"analyzer": { "a2" : { | |
"type":"custom", | |
"tokenizer": "standard", | |
"filter": ["lowercase", "snowball"] | |
} | |
} | |
} | |
} | |
} | |
}' | |
curl -XPUT localhost:9200/twitter/_mapping -d '{ | |
"tweet" : { | |
"date_formats" : ["yyyy-MM-dd", "dd-MM-yyyy"], | |
"properties" : { | |
"user": {"type":"string"}, | |
"message" : {"type" : "string", "analyzer":"a2"} | |
} | |
}}' | |
curl -XPUT http://localhost:9200/twitter/tweet/1 -d '{ "user": "kimchy", "post_date": "2009-11-15T13:12:00", "message": "Trying out searching teaching, so far so good?" }' | |
curl -XGET localhost:9200/twitter/tweet/_search?q=message:search | |
curl -XGET localhost:9200/twitter/tweet/_search?q=message:try |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 24 should be:
instead of: