Created
July 11, 2014 14:11
-
-
Save ArFeRR/3031c1ce8f95549ad86d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "http://localhost:9200/test/" | |
curl -XPUT "http://localhost:9200/test/" | |
curl -XPUT 'http://localhost:9200/test/prodtest/_mapping' -d ' | |
{ | |
"prodtest" : { | |
"properties" : { | |
"category" : { | |
"type" : "string", | |
"store" : true | |
}, | |
"name" : { | |
"type" : "string", | |
"store" : true | |
}, | |
"price" : { | |
"type" : "string", | |
"store" : true | |
}, | |
"productsOptionValues" : { | |
"type" : "nested", | |
"properties" : { | |
"productOption" : { | |
"type" : "string", | |
"store" : true | |
}, | |
"value" : { | |
"type" : "string", | |
"index" : "not_analyzed", | |
"store" : true | |
} | |
} | |
} | |
} | |
} | |
} | |
' | |
curl -XPUT http://localhost:9200/test/prodtest/1 -d ' | |
{ | |
"name":"Lenovo G505G", | |
"price":"3661.00", | |
"category":"LENOVO", | |
"productsOptionValues":[ | |
{ | |
"productOption":"weight", | |
"value":"2,6kg" | |
}, | |
{ | |
"productOption":"resolution", | |
"value":"1366x768" | |
}, | |
{ | |
"productOption":"processor", | |
"value":"AMD E1-2100 1 Ghz" | |
}, | |
{ | |
"productOption":"memory", | |
"value":"2 GB" | |
} | |
] | |
} | |
' | |
curl -XPUT http://localhost:9200/test/prodtest/2 -d ' | |
{ | |
"name":"Dell Inspiron 3721", | |
"price":"5010.00", | |
"category":"DELL", | |
"productsOptionValues":[ | |
{ | |
"productOption":"weight", | |
"value":"2,7 kg" | |
}, | |
{ | |
"productOption":"resolution", | |
"value":"1600x900" | |
}, | |
{ | |
"productOption":"processor", | |
"value":"Intel Pentium 2117U 1,8 ghz" | |
}, | |
{ | |
"productOption":"memory", | |
"value":"4 GB" | |
} | |
] | |
} | |
' | |
curl -XPUT http://localhost:9200/test/prodtest/3 -d ' | |
{ | |
"name":"Lenovo IdeaPad Z710A", | |
"price":"8308.00", | |
"category":"LENOVO", | |
"productsOptionValues":[ | |
{ | |
"productOption":"weight", | |
"value":"2,9 kg" | |
}, | |
{ | |
"productOption":"resolution", | |
"value":"1920x1080" | |
}, | |
{ | |
"productOption":"processor", | |
"value":"Intel Core i3-4000M 2,4 ghz" | |
}, | |
{ | |
"productOption":"memory", | |
"value":"4 GB" | |
} | |
] | |
} | |
' | |
curl -XPUT http://localhost:9200/test/prodtest/4 -d ' | |
{ | |
"name":"Dell Inspiron 5721", | |
"price":"10395.00", | |
"category":"DELL", | |
"productsOptionValues":[ | |
{ | |
"productOption":"weight", | |
"value":"2,3 kg" | |
}, | |
{ | |
"productOption":"resolution", | |
"value":"1920x1080" | |
}, | |
{ | |
"productOption":"processor", | |
"value":"Intel Core i5-3337U" | |
}, | |
{ | |
"productOption":"memory", | |
"value":"8 GB" | |
} | |
] | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment