def search(self, query, limit=15, offset=0, index=None):
        """
        Query the search service.

        :param query: The query.
        :param limit: The maximal number of results to return (at most 500).
        :param offset: Use to page through big search result sets.
        :param index: Name of the index to search in (metadata|fulltext) or `None`.
        :return:
        """
        params = dict(limit=limit, offset=offset)
        if index:
            assert index in ['metadata', 'fulltext']
            params['indexselection'] = index
        if isinstance(query, string_types):
            query = {"query_string": {"query": query}}
        # elif isinstance(query, ElasticQuery):
        #    query = query.dict()
        assert isinstance(query, dict)
        return resource.SearchResults(self, self._req(
            '/search/',
            method='post',
            params=params,
            headers={'content-type': 'application/json'},
            data=json.dumps(query)))
Query the search service.

        :param query: The query.
        :param limit: The maximal number of results to return (at most 500).
        :param offset: Use to page through big search result sets.
        :param index: Name of the index to search in (metadata|fulltext) or `None`.
        :return: