def _search_metrics_and_metadata(self, metadata_endpoint, query,<EOL>order_by=None, offset=None,<EOL>limit=None, timeout=None):
_logger.debug('<STR_LIT>',<EOL>{'<STR_LIT>': query, '<STR_LIT>': metadata_endpoint})<EOL>url_to_get = '<STR_LIT>'.format(self._u(metadata_endpoint), query)<EOL>if order_by is not None:<EOL><INDENT>url_to_get += '<STR_LIT>' + order_by<EOL><DEDENT>if offset is not None:<EOL><INDENT>url_to_get += '<STR_LIT>' + str(offset)<EOL><DEDENT>if limit is not None:<EOL><INDENT>url_to_get += '<STR_LIT>' + str(limit)<EOL><DEDENT>timeout = timeout or self._timeout<EOL>resp = self._get(url_to_get, session=self._session, timeout=timeout)<EOL>resp.raise_for_status()<EOL>return resp.json()<EOL>
generic function for elasticsearch queries; can search metrics,
    dimensions, metrictimeseries by changing metadata_endpoint
Args:
    metadata_endpoint (string): API endpoint suffix (e.g. 'v2/metric')
    query (string): elasticsearch string query
    order_by (optional[string]): property by which to order results
    offset (optional[int]): number of results to skip for pagination
        (default=0)
    limit (optional[int]): how many results to return (default=50)
    timeout (optional[int]): how long to wait for response (in seconds)

Returns:
    dictionary of query result