Skip to content

Instantly share code, notes, and snippets.

@markharwood
Created October 25, 2016 14:37
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 markharwood/6cd7fc2d139f7a775af3da7fb6636e34 to your computer and use it in GitHub Desktop.
Save markharwood/6cd7fc2d139f7a775af3da7fb6636e34 to your computer and use it in GitHub Desktop.
DELETE institute
PUT institute
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"doc": {
"properties": {
"institute_id_and_label": {
"type": "keyword"
}
}
}
}
}
POST institute/doc
{
"institute_id_and_label":"[23] St. Xaviers College"
}
POST institute/doc
{
"institute_id_and_label":"[22] Harvard"
}
========================
DELETE recruiters
PUT recruiters
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"doc": {
"properties": {
"recruiter_id_and_label": {
"type": "keyword"
}
}
}
}
}
POST recruiters/doc
{
"recruiter_id_and_label":"[25] Oracle"
}
============================
DELETE staff
PUT staff
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"doc": {
"properties": {
"staff_id_and_label": {
"type": "keyword"
}
}
}
}
}
POST staff/doc
{
"staff_id_and_label":"[31] Mark"
}
=============================
DELETE relationship
PUT relationship
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"doc": {
"properties": {
"institute_id_and_label": {
"type": "keyword"
},
"staff_id_and_label": {
"type": "keyword"
},
"recruiter_id_and_label": {
"type": "keyword"
}
}
}
}
}
POST relationship/doc
{
"staff_id_and_label":"[31] Mark",
"institute_id_and_label":"[23] St. Xaviers College"
}
POST relationship/doc
{
"recruiter_id_and_label":"[25] Oracle",
"institute_id_and_label":"[23] St. Xaviers College"
}
POST relationship/doc
{
"recruiter_id_and_label":"[25] Oracle",
"institute_id_and_label":"[22] Harvard"
}
============================
POST /_aliases
{
"actions": [
{
"add": {
"index": "recruiters",
"alias": "marketplace"
}
},
{
"add": {
"index": "staff",
"alias": "marketplace"
}
},
{
"add": {
"index": "institute",
"alias": "marketplace"
}
},
{
"add": {
"index": "relationship",
"alias": "marketplace"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment