aparo/pyes — pull request #271 by iserko (2013-03-21 11:07:50+00:00)
Title: getting the attribute hits from a ResultSet results in inconsistent behaviour

When you attempt to get the attribute hits from a result set, the __getattr__ method is called which in turn runs _do_search if there are no results and then proceeds on to get the attribute "hits", which is a dictionary.
When you run it for a 2nd time resultset.hits returns the proper value, which is a list. The reason for this is because _do_search sets the hits attribute on the resultset.