How to use the pandasticsearch.client.RestClient function in pandasticsearch

To help you get started, we’ve selected a few pandasticsearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github onesuper / pandasticsearch / pandasticsearch / dataframe.py View on Github external
url = kwargs.get('url', 'http://localhost:9200')
        compat = kwargs.get('compat', 2)
        username = kwargs.get('username', None)
        password = kwargs.get('password', None)
        verify_ssl = kwargs.get('verify_ssl', True)

        if index is None:
            raise ValueError('Index name must be specified')

        mapping = RestClient(url, index, username, password, verify_ssl).get()

        if doc_type is None:
            endpoint = index + '/_search'
        else:
            endpoint = index + '/' + doc_type + '/_search'
        return DataFrame(client=RestClient(url, endpoint, username, password, verify_ssl),
                         mapping=mapping, index=index, doc_type=doc_type, compat=compat)
github onesuper / pandasticsearch / pandasticsearch / api.py View on Github external
def __init__(self, url, index, type=None):
        if type is None:
            endpoint = index + '/_search'
        else:
            endpoint = index + '/' + type + '/_search'
        self._client = RestClient(url, endpoint)

        # setup the columns(properties)
        if type is None:
            mapping_endpoint = index
        else:
            mapping_endpoint = index + '/_mapping/' + type

        mapping_client = RestClient(url, mapping_endpoint)
        self._mapping_json = mapping_client.get()

        self._columns = []
        for _, mappings in six.iteritems(self._mapping_json):
            for _, properties in six.iteritems(mappings['mappings']):
                for k, _ in six.iteritems(properties['properties']):
                    self._columns.append(k)
github onesuper / pandasticsearch / pandasticsearch / dataframe.py View on Github external
>>> from pandasticsearch import DataFrame
        >>> df = DataFrame.from_es('http://localhost:9200', index='people')
        """

        doc_type = kwargs.get('doc_type', None)
        index = kwargs.get('index', None)
        url = kwargs.get('url', 'http://localhost:9200')
        compat = kwargs.get('compat', 2)
        username = kwargs.get('username', None)
        password = kwargs.get('password', None)
        verify_ssl = kwargs.get('verify_ssl', True)

        if index is None:
            raise ValueError('Index name must be specified')

        mapping = RestClient(url, index, username, password, verify_ssl).get()

        if doc_type is None:
            endpoint = index + '/_search'
        else:
            endpoint = index + '/' + doc_type + '/_search'
        return DataFrame(client=RestClient(url, endpoint, username, password, verify_ssl),
                         mapping=mapping, index=index, doc_type=doc_type, compat=compat)
github onesuper / pandasticsearch / pandasticsearch / api.py View on Github external
def __init__(self, url, index, type=None):
        if type is None:
            endpoint = index + '/_search'
        else:
            endpoint = index + '/' + type + '/_search'
        self._client = RestClient(url, endpoint)

        # setup the columns(properties)
        if type is None:
            mapping_endpoint = index
        else:
            mapping_endpoint = index + '/_mapping/' + type

        mapping_client = RestClient(url, mapping_endpoint)
        self._mapping_json = mapping_client.get()

        self._columns = []
        for _, mappings in six.iteritems(self._mapping_json):
            for _, properties in six.iteritems(mappings['mappings']):
                for k, _ in six.iteritems(properties['properties']):
                    self._columns.append(k)

        self._filter = None
        self._last_query = None