Skip to content

Instantly share code, notes, and snippets.

@glallen01
Last active September 4, 2019 01:32
Show Gist options
  • Save glallen01/0bfb5710697ccaa884a96239ad39e210 to your computer and use it in GitHub Desktop.
Save glallen01/0bfb5710697ccaa884a96239ad39e210 to your computer and use it in GitHub Desktop.
doc update
(emacs-version)
GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.5.0, Carbon Version 158 AppKit 1671.4)
 of 2019-08-29
GET /
{
  "name" : "63d4393c731c",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "5w6neq12QuaPFsFZnw2qxg",
  "version" : {
    "number" : "7.3.1",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "4749ba6",
    "build_date" : "2019-08-19T20:19:25.651794Z",
    "build_snapshot" : false,
    "lucene_version" : "8.1.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
POST /test/_doc/
{
  "domain": "google.com"
}
{"_index":"test","_type":"_doc","_id":"0Nbf-WwB8lepZEpMODCK","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1}
POST /test/_doc/
{
  "domain": "yahoo.com"
}
{"_index":"test","_type":"_doc","_id":"0dbf-WwB8lepZEpMSjCl","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":1,"_primary_term":1}
GET /test/_search?q=domain:google.com&pretty
[
  {
    "_index": "test",
    "_type": "_doc",
    "_id": "0Nbf-WwB8lepZEpMODCK",
    "_score": 0.6931472,
    "_source": {
      "domain": "google.com"
    }
  }
]
POST /test/_update/0Nbf-WwB8lepZEpMODCK
{
  "script": "ctx._source.ownedby = 'californians'"
}
{"_index":"test","_type":"_doc","_id":"0Nbf-WwB8lepZEpMODCK","_version":2,"result":"updated","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":2,"_primary_term":1}
GET /test/_search?q=domain:google.com&pretty
[
  {
    "_index": "test",
    "_type": "_doc",
    "_id": "0Nbf-WwB8lepZEpMODCK",
    "_score": 0.47000363,
    "_source": {
      "domain": "google.com",
      "ownedby": "californians"
    }
  }
]
GET /test/_search?q=domain:*&pretty
{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 2,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "test",
        "_type" : "_doc",
        "_id" : "0dbf-WwB8lepZEpMSjCl",
        "_score" : 1.0,
        "_source" : {
          "domain" : "yahoo.com"
        }
      },
      {
        "_index" : "test",
        "_type" : "_doc",
        "_id" : "0Nbf-WwB8lepZEpMODCK",
        "_score" : 1.0,
        "_source" : {
          "domain" : "google.com",
          "ownedby" : "californians"
        }
      }
    ]
  }
}
DELETE /test
{"acknowledged":true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment