Skip to content

Instantly share code, notes, and snippets.

@bdargan
Created March 15, 2011 13:31
Show Gist options
  • Save bdargan/870714 to your computer and use it in GitHub Desktop.
Save bdargan/870714 to your computer and use it in GitHub Desktop.
Elastic Search snowball Sample
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
@boushley
Copy link

Line 24 should be:

curl -XPUT localhost:9200/twitter/tweet/_mapping -d '{

instead of:

curl -XPUT localhost:9200/twitter/_mapping -d '{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment