Skip to content

Instantly share code, notes, and snippets.

@sticky1
Created November 21, 2013 06:13
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 sticky1/7576821 to your computer and use it in GitHub Desktop.
Save sticky1/7576821 to your computer and use it in GitHub Desktop.
curl -XPUT localhost:9200/testindex/member/data1 -d '{
"memberGender":"F",
"name":"Sam",
"amount":[{
"serviceMonth":"2009-11-15",
"paidMonth":"2009-12-15",
"paidAmount":100
},
{
"serviceMonth":"2009-12-15",
"paidMonth":"2010-01-15",
"paidAmount":100
}]
}'
curl -XPUT localhost:9200/testindex/member/data2 -d '{
"name":"Paul",
"amount":[{
"serviceMonth":"2009-11-15",
"paidMonth":"2010-12-15",
"paidAmount":100
},
{
"serviceMonth":"2011-12-15",
"paidMonth":"2012-01-15",
"paidAmount":100
}]
}'
curl -XPUT localhost:9200/testindex/Member/_mapping -d '{
"Member": {
"properties": {
"name": {
"type": "string",
"index": "not_analyzed"
},
"amount": {
"type": "nested",
"properties": {
"serviceMonth": {
"type": "date",
"format": "dateOptionalTime"
},
"paidMonth": {
"type": "date",
"format": "dateOptionalTime"
},
"paidAmount": {
"type": "double"
}
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment