opensearch_py_ml.Index

class opensearch_py_ml.Index(query_compiler: QueryCompiler, os_index_field: str | None = None)[source]

The index for an opensearch_py_ml.DataFrame.

TODO - This currently has very different behaviour than pandas.Index

Currently, the index is a field that exists in every document in an OpenSearch index. For slicing and sorting operations it must be a docvalues field. By default _id is used, which can’t be used for range queries and is inefficient for sorting.

(The value of the _id field is also accessible in aggregations or for sorting, but doing so is discouraged as it requires to load a lot of data in memory. In case sorting or aggregating on the _id field is required, it is advised to duplicate the content of the _id field in another field that has doc_values enabled.)