Skip to content

Instantly share code, notes, and snippets.

@razorcd
Last active August 2, 2018 07:59
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 razorcd/72aab2634d9702773e8c53a91557ade6 to your computer and use it in GitHub Desktop.
Save razorcd/72aab2634d9702773e8c53a91557ade6 to your computer and use it in GitHub Desktop.
Elasticsearch - CRUD document sync

CREATE

POST localhost:9200/index/type?refresh

{
  "ssoId": "s0000000001",
  "externalSsoType": "U",
  "socketNumber": "s0000000001",
  "deviceNote": null,
  "isTaken": null,
  "active": null,
  "address": {
    "street": "ssssssss",
    "street2": "ssss",
    "city": "Berlin",
    "zipCode": "10829",
    "country": "DE",
    "location": {
      "lat": 52.51126,
      "lon": 13.375999
    }
  },
  "isPublic": true,
  "addressAdd1": "lorem ipsum",
  "addressAdd2": "lorem ipsum",
  "addressAdd3": "lorem ipsum",
  "state": "ACTIVE"
}

CREATE 2

POST localhost:9200/index/type?refresh

{
  "creationTime": 1512393216612,
  "lastModificationTime": null,
  "ssoId": "s0000000001",
  "enabled": true
}

DELETE

DELETE localhost:9200/index/type/00000000000000000000?refresh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment