Skip to content

Instantly share code, notes, and snippets.

@imotov
Created October 6, 2014 16:20
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 imotov/60f0c8f00819eb2d0004 to your computer and use it in GitHub Desktop.
Save imotov/60f0c8f00819eb2d0004 to your computer and use it in GitHub Desktop.
curl -XDELETE "localhost:9200/myindex?pretty"
curl -XPUT "localhost:9200/myindex?pretty" -d '{
"mappings" : {
"inventory" : {
"_all" : {
"auto_boost" : true
},
"properties" : {
"id" : {
"type" : "long",
"include_in_all" : false
},
"counterPartyCode" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}'
curl -XPUT "localhost:9200/myindex/inventory/7774?pretty" -d '{
"brand" : "HAL",
"commodity" : "Aluminium",
"counterParty" : "Acme Aloominem Company",
"counterPartyCode" : "ACME",
"grade" : "99.7%",
"id" : 7774,
"indirectTaxRegion" : null,
"netGainLoss" : 0.0000,
"netGainLossUnitOfMeasure" : "MT"
}'
curl -XPOST "localhost:9200/myindex/_refresh?pretty"
curl -XPOST "localhost:9200/myindex/inventory/_search?pretty" -d '{
"from" : 0,
"size" : 20,
"query" : {
"filtered" : {
"query" : {
"match_all" : { }
},
"filter" : {
"and" : {
"filters" : [ {
"type" : {
"value" : "inventory"
}
}, {
"term" : {
"id" : "7774"
}
} ]
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment