def __init__(self, connection, search, indices=None, doc_types=None, query_params=None,<EOL>headers=None, auto_fix_keys=False, auto_clean_highlight=False, model=None):
from .query import Search<EOL>if not isinstance(search, Search):<EOL><INDENT>raise InvalidQuery("<STR_LIT>")<EOL><DEDENT>self.search = search<EOL>self.connection = connection<EOL>self.indices = indices<EOL>self.doc_types = doc_types<EOL>self.query_params = query_params or {}<EOL>self.headers = headers<EOL>self.scroller_parameters = {}<EOL>self.scroller_id = None<EOL>self._results = None<EOL>self.model = model or self.connection.model<EOL>self._total = None<EOL>self._max_score = None<EOL>self.valid = False<EOL>self._facets = {}<EOL>self._aggs = {}<EOL>self._hits = []<EOL>self.auto_fix_keys = auto_fix_keys<EOL>self.auto_clean_highlight = auto_clean_highlight<EOL>self.iterpos = <NUM_LIT:0>  <EOL>self.start = query_params.get("<STR_LIT:start>", search.start) or <NUM_LIT:0><EOL>self._max_item = query_params.get("<STR_LIT:size>", search.size)<EOL>self._current_item = <NUM_LIT:0><EOL>if search.bulk_read is not None:<EOL><INDENT>self.chuck_size = search.bulk_read<EOL><DEDENT>elif search.size is not None:<EOL><INDENT>self.chuck_size = search.size<EOL><DEDENT>else:<EOL><INDENT>self.chuck_size = <NUM_LIT:10><EOL><DEDENT>
results: an es query results dict
fix_keys: remove the "_" from every key, useful for django views
clean_highlight: removed empty highlight
search: a Search object.