0

I am using elastic search for the project I'm working on and I was wondering if there was a way to narrow the results I get from an indices stats search. https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html

I currently use the docs to narrow the data I get back about the indices but now I want to only get back ones with a doc count greater than 0. Does anyone know if this is possible or how to?

Thanks!

For elastic search 1.5.2

David Carek
  • 1,103
  • 1
  • 12
  • 26

1 Answers1

1

If you're concerned about the size of the response (i.e. if you many many indices with many shards), the best you can do is to use response filtering (available only since ES 1.7) and only retrieve the docs field that you can further filter on the client-side:

curl 'localhost:9200/_stats/docs?pretty&filter_path=**.docs.count'
Val
  • 207,596
  • 13
  • 358
  • 360
  • I just learned we are using elastic search 1.5.2 so this won't work. :( – David Carek Aug 20 '15 at 12:16
  • Ouch, bad luck. Then I guess you're left with filtering the response on the client-side, but if you don't have thousands of indices/shards, that should be ok. – Val Aug 20 '15 at 12:20