Blog Archive for October 11, 2016

Searching Elasticsearch

October 11, 2016

I wanted to return a list of entries from ElasticSearch, and I wanted to just return ones where the _type field was set to c.

http://host:9200/logstash-2016.10.05/_search?q=_type:c&pretty=true

This URL will filter to just the rows with a _type of c.

{
  "took" : 28,
  "timed_out" : false,
  "_shards" : {
    "total" …

Listing ElasticSearch indexes

October 11, 2016

To find out a top level list of indexes in an ElasticSearch database, use:

http://host:9200/_cat/indices?v

which returns something like

health status index               pri rep docs.count docs.deleted store.size pri.store.size 
yellow open   logstash-2016.10.06   5   1      18908            0        6mb            6mb 
yellow open   .kibana               1   1          5            1     25.4kb         25.4kb 
yellow open   logstash-2016.10.08   5 …