Skip to content

Instantly share code, notes, and snippets.

@monken
Created July 19, 2011 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monken/1091985 to your computer and use it in GitHub Desktop.
Save monken/1091985 to your computer and use it in GitHub Desktop.
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test
curl -XPUT localhost:9200/test/type1/_mapping -d '
{
"author" : {
"dynamic" : "false",
"_source" : {
"compress" : true
},
"properties" : {
"region" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"website" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"location" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"pauseid" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"perlmongers" : {
"dynamic" : "false",
"properties" : {
"name" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"url" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
}
}
},
"donation" : {
"dynamic" : "false",
"properties" : {
"id" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"name" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
}
}
},
"blog" : {
"dynamic" : "false",
"properties" : {
"feed" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"url" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
}
}
},
"city" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"country" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"updated" : {
"store" : "yes",
"format" : "dateOptionalTime",
"type" : "date"
},
"dir" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"email" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"asciiname" : {
"type" : "multi_field",
"fields" : {
"asciiname" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"analyzed" : {
"include_in_all" : false,
"store" : "yes",
"analyzer" : "standard",
"type" : "string"
}
}
},
"name" : {
"type" : "multi_field",
"fields" : {
"analyzed" : {
"include_in_all" : false,
"store" : "yes",
"analyzer" : "standard",
"type" : "string"
},
"name" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
}
}
},
"gravatar_url" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"profile" : {
"dynamic" : "false",
"properties" : {
"id" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
},
"name" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
}
}
}
}
}
}
'
curl -XPOST localhost:9200/test/type1/MO?refresh=1 -d '
{"country":"DE","profile":[{"name":"github","id":"monken"},{"name":"facebook","id":"moritz.onken"},{"name":"twitter","id":"moritzonken"}],"gravatar_url":"http://www.gravatar.com/avatar/874db45ef3a1c18dec3cb18349f1e713","website":["http://metacpan.org/"],"donation":[{"name":"paypal","id":"onken@houseofdesign.de"}],"name":"Moritz Onken","region":"BW","blog":[{"feed":"http://blogs.perl.org/users/mo/atom.xml","url":"http://blogs.perl.org/users/mo/"},{"feed":"http://blog.netcubed.de/feed/","url":"http://blog.netcubed.de/"}],"dir":"id/M/MO/MO","email":["onken@netcubed.de"],"city":"Karlsruhe","updated":"2011-07-19T11:11:33","perlmongers":[{"name":"test.pm"}],"pauseid":"MO"}
'
curl 'localhost:9200/test/type1/MO'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment