aparo / pyes

Python connector for ElasticSearch - the pythonic way to use ElasticSearch
BSD 3-Clause "New" or "Revised" License
607 stars 270 forks source link

The behavior of ResultSet makes confusing #493

Open lafengnan opened 9 years ago

lafengnan commented 9 years ago

The object of pyes.es.ResultSet makes me confusing. When I use pyes.es.Es.search() to retrieve data from Elasticsearch, it returns an object x of pyes.es.ResultSet which has len(), total, count()... methods defined. But if the index is non-existing, len(x) or x.total, or x.count() will raise IndexMissingException, it makes me confusing. Since I wondering a 0 is returned if no data retrieved, but in practice I got an exception!!!