Skip to content

Instantly share code, notes, and snippets.

@imotov imotov/test.sh
Created Oct 6, 2014

Embed
What would you like to do?
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
You can’t perform that action at this time.