nisham22
10/9/2017 - 6:48 AM

Elasticsearch

Must_not

{
  "size": 100,
  "query": {
    "bool": {
      "must_not": [
        {
          "exists": {
            "field": "fieldname"
          }
        }
      ]
    }
  }
}

Aggregation

{
  "size": 0,
  "aggs": {
    "adsa": {
      "terms": {
        "field": "fieldname.keyword",
        "size": 100000
      }
    }
  }
}

Download Head

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start

Cors for elasticsearch.yml

network.host: 0.0.0.0
transport.host: 127.0.0.1
http.host: 0.0.0.0
http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length

Path to install plugin in es-service

/usr/share/elasticsearch
sudo bin/elasticsearch-plugin list
sudo bin/elasticsearch-plugin install repository-azure

Path to es-service yml

/etc/elasticsearch