Series

class opensearch_py_ml.Series(os_client: OpenSearch | None = None, os_index_pattern: str | None = None, name: str | None = None, os_index_field: str | None = None, _query_compiler: QueryCompiler | None = None)[source]

pandas.Series like API that proxies into OpenSearch index(os).

Parameters

os_clientopensearchpy.OpenSearch

A reference to a OpenSearch python client

os_index_patternstr

An OpenSearch index pattern. This can contain wildcards.

os_index_fieldstr

The field to base the series on

Notes

If the OpenSearch index is deleted or index mappings are changed after this object is created, the object is not rebuilt and so inconsistencies can occur.

See Also

:pandas_api_docs:`pandas.Series`

Examples

>>> from tests import OPENSEARCH_TEST_CLIENT
>>> oml.Series(os_client=OPENSEARCH_TEST_CLIENT, os_index_pattern='flights', name='Carrier')
0         Kibana Airlines
1        Logstash Airways
2        Logstash Airways
3         Kibana Airlines
4         Kibana Airlines
               ...
13054    Logstash Airways
13055    Logstash Airways
13056    Logstash Airways
13057            JetBeats
13058            JetBeats
Name: Carrier, Length: 13059, dtype: object