Skip to content

Instantly share code, notes, and snippets.

@jsbonline2006
Created February 27, 2014 03:44
Show Gist options
  • Save jsbonline2006/9243973 to your computer and use it in GitHub Desktop.
Save jsbonline2006/9243973 to your computer and use it in GitHub Desktop.
One Index 2 data type join query
# delete old index if exists
curl -XDELETE 'http://localhost:9200/productindex?pretty'
# Create new Index productindex
curl -XPUT 'http://localhost:9200/productindex?pretty' -d '{}'
# Insert data in productindex for offertype
curl -XPUT 'http://localhost:9200/productindex/offertype/1?pretty' -d '{"skuid": "1983001", "offer_id": "promo00001,promo00002,promo00003"}'
curl -XPUT 'http://localhost:9200/productindex/offertype/2?pretty' -d '{"skuid": "1983002", "offer_id": "promo00001,promo00002"}'
curl -XPUT 'http://localhost:9200/productindex/offertype/3?pretty&refresh=true' -d '{"skuid": "1983003", "offer_id": "promo00001,promo00003"}'
# Insert data in productindex for categorytype
curl -XPUT 'http://localhost:9200/productindex/categorytype/4?pretty' -d '{"skuid": "1983004", "category": "Mobile"}'
curl -XPUT 'http://localhost:9200/productindex/categorytype/5?pretty' -d '{"skuid": "1983005", "category": "Mobile"}'
curl -XPUT 'http://localhost:9200/productindex/categorytype/6?pretty&refresh=true' -d '{"skuid": "1983006", "category": "Mobile"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment