Created
October 6, 2014 16:20
-
-
Save imotov/60f0c8f00819eb2d0004 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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