2021-08-20 18:47:52 +03:00
2021-08-19 09:48:02 +05:30
2021-08-19 07:58:20 +05:30
2021-08-19 07:58:20 +05:30
2021-08-13 11:45:36 +05:30
2021-08-10 18:37:42 +05:30
2021-08-18 19:12:47 +05:30
2021-08-19 07:58:20 +05:30
2021-08-19 07:58:20 +05:30
2021-08-19 13:08:26 +05:30
2021-08-19 07:58:20 +05:30
2021-08-13 11:45:36 +05:30

OpenSearch logo

OpenSearch Python Client

Welcome!

opensearch-py is a community-driven, open source fork of elasticsearch-py licensed under the Apache v2.0 License. For more information, see opensearch.org.

This is the low-level client. A high-level Python client is in the works, and will be available soon.

Example use


>>> from datetime import datetime
>>> from opensearch import OpenSearch

# by default we connect to localhost:9200
>>> client = OpenSearch()

# create an index in OpenSearch, ignore status code 400 (index already exists)
>>> client.indices.create(index='my-index', ignore=400)
{'acknowledged': True, 'shards_acknowledged': True, 'index': 'my-index'}

# datetimes will be serialized
>>> client.index(index="my-index", id=42, body={"any": "data", "timestamp": datetime.now()})
{'_index': 'my-index',
    '_type': '_doc',
    '_id': '42',
    '_version': 1,
    'result': 'created',
    '_shards': {'total': 2, 'successful': 1, 'failed': 0},
    '_seq_no': 0,
    '_primary_term': 1}

# but not deserialized
>>> client.get(index="my-index", id=42)['_source']
{'any': 'data', 'timestamp': '2019-05-17T17:28:10.329598'}

Project Resources

Code of Conduct

This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ, or contact opensource-codeofconduct@amazon.com with any additional questions or comments.

License

This project is licensed under the Apache v2.0 License.

Copyright OpenSearch Contributors. See NOTICE for details.

Languages
Python 99.4%
Shell 0.6%