Skip to content

Instantly share code, notes, and snippets.

@monken
Created March 17, 2011 08:33
Show Gist options
  • Select an option

  • Save monken/874006 to your computer and use it in GitHub Desktop.

Select an option

Save monken/874006 to your computer and use it in GitHub Desktop.
curl -XDELETE localhost:9200/blogs/
curl -XPUT localhost:9200/blogs/
curl -XPUT localhost:9200/blogs/blog/_mapping -d '
{
"blog": {
"properties": { "title": { "type": "string", "store": "yes" } }
}
}
'
curl -XPUT localhost:9200/blogs/post/_mapping -d '
{
"post": {
"_parent": { "type": "blog" },
"properties": { "message": { "type": "string" } }
}
}
'
curl -XGET localhost:9200/blogs/_mapping?pretty=1
curl -XPUT localhost:9200/blogs/blog/1 -d '{"title":"My Blog"}'
curl -XPUT 'localhost:9200/blogs/post/1?parent=1&refresh=1' -d '{"message":"Hello there!"}'
curl -XPOST localhost:9200/blogs/post/_search -d '
{
"query": { "match_all": {}},
"fields": ["_parent", "_parent.title"]
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment