# Path: elasticmagic/index.py
# class BaseIndex(with_metaclass(ABCMeta)):
#     def __init__(self, cluster, name):
#         self._cluster = cluster
#         self._name = name
# 
#         self._doc_cls_cache = {}
# 
#     def __getitem__(self, doc_type):
#         return self.get_doc_cls(doc_type)
# 
#     def get_doc_cls(self, doc_type):
#         if doc_type not in self._doc_cls_cache:
#             self._doc_cls_cache[doc_type] = type(
#                 '{}{}'.format(to_camel_case(doc_type), 'Document'),
#                 (DynamicDocument,),
#                 {'__doc_type__': doc_type}
#             )
#         return self._doc_cls_cache[doc_type]
# 
#     def get_name(self):
#         return self._name
# 
#     def get_cluster(self):
#         return self._cluster
# 
#     def get_settings(self):
#         return self._cluster._client.indices.get_settings(index=self._name)
# 
#     def search_query(self, *args, **kwargs):
#         """Returns a :class:`search.SearchQuery` instance that is bound to this
#         index.
#         """
#         kwargs['index'] = self
#         return self._cluster._search_query_cls(*args, **kwargs)
# 
#     def query(self, *args, **kwargs):
#         return self.search_query(*args, **kwargs)


from ...index import BaseIndex
            self, docs, doc_type=None, source=None, realtime=None,
            routing=None, preference=None, refresh=None, **kwargs
    ):
        return await self._cluster.multi_get(
            docs, index=self._name, doc_type=doc_type, source=source,
            realtime=realtime, routing=routing, preference=preference,
            refresh=refresh, **kwargs
        )

    mget = multi_get

    async def search(
            self, q, doc_type=None, routing=None, preference=None,
            timeout=None, search_type=None, query_cache=None,
            terminate_after=None, scroll=None, stats=None, **kwargs
    ):
        return await self._cluster.search(
            q, index=self._name, doc_type=doc_type,
            routing=routing, preference=preference, timeout=timeout,
            search_type=search_type, query_cache=query_cache,
            terminate_after=terminate_after, scroll=scroll, stats=stats,
            **kwargs
        )

    async def explain(
            self, q, doc_or_id, doc_cls=None, routing=None, **kwargs
    ):
        return await self._cluster.explain(
            q, doc_or_id, index=self._name, doc_cls=doc_cls, routing=routing,
            **kwargs

# Path: elasticmagic/index.py
# class BaseIndex(with_metaclass(ABCMeta)):
#     def __init__(self, cluster, name):
#         self._cluster = cluster
#         self._name = name
# 
#         self._doc_cls_cache = {}
# 
#     def __getitem__(self, doc_type):
#         return self.get_doc_cls(doc_type)
# 
#     def get_doc_cls(self, doc_type):
#         if doc_type not in self._doc_cls_cache:
#             self._doc_cls_cache[doc_type] = type(
#                 '{}{}'.format(to_camel_case(doc_type), 'Document'),
#                 (DynamicDocument,),
#                 {'__doc_type__': doc_type}
#             )
#         return self._doc_cls_cache[doc_type]
# 
#     def get_name(self):
#         return self._name
# 
#     def get_cluster(self):
#         return self._cluster
# 
#     def get_settings(self):
#         return self._cluster._client.indices.get_settings(index=self._name)
# 
#     def search_query(self, *args, **kwargs):
#         """Returns a :class:`search.SearchQuery` instance that is bound to this
#         index.
#         """
#         kwargs['index'] = self
#         return self._cluster._search_query_cls(*args, **kwargs)
# 
#     def query(self, *args, **kwargs):
#         return self.search_query(*args, **kwargs)


# Path: elasticmagic/ext/asyncio/index.py
from ...index import BaseIndex

            self, docs, doc_type=None, source=None, realtime=None,
            routing=None, preference=None, refresh=None, **kwargs
    ):
        return await self._cluster.multi_get(
            docs, index=self._name, doc_type=doc_type, source=source,
            realtime=realtime, routing=routing, preference=preference,
            refresh=refresh, **kwargs
        )

    mget = multi_get

    async def search(
            self, q, doc_type=None, routing=None, preference=None,
            timeout=None, search_type=None, query_cache=None,
            terminate_after=None, scroll=None, stats=None, **kwargs
    ):
        return await self._cluster.search(
            q, index=self._name, doc_type=doc_type,
            routing=routing, preference=preference, timeout=timeout,
            search_type=search_type, query_cache=query_cache,
            terminate_after=terminate_after, scroll=scroll, stats=stats,
            **kwargs
        )

    async def explain(
            self, q, doc_or_id, doc_cls=None, routing=None, **kwargs
    ):
        return await self._cluster.explain(
            q, doc_or_id, index=self._name, doc_cls=doc_cls, routing=routing,
            **kwargs

        )