bf3a04b2639c38ca2943f71135237bb8c050bd52
Signed-off-by: Rushi Agrawal <rushi.agr@gmail.com>
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.
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
- Project Website
- Downloads.
- Documentation
- Need help? Try Forums
- Project Principles
- Contributing to OpenSearch
- Maintainer Responsibilities
- Release Management
- Admin Responsibilities
- Security
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
Copyright OpenSearch Contributors. See NOTICE for details.
Description
Languages
Python
99.4%
Shell
0.6%