From 689c3f94c082b091884e122e27fa2645b6437e1c Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 1 Nov 2024 15:59:08 +0700 Subject: [PATCH] Updated Readme --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 40a9aa1..c1f7ef9 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,12 @@ configuration = manticoresearch.Configuration( with manticoresearch.ApiClient(configuration) as api_client: # Create an instance of the IndexApi API class api_instance = manticoresearch.IndexApi(api_client) - body = "["'{\"insert\": {\"index\": \"test\", \"id\": 1, \"doc\": {\"title\": \"Title 1\"}}},\\n{\"insert\": {\"index\": \"test\", \"id\": 2, \"doc\": {\"title\": \"Title 2\"}}}'"]" # str | try: - # Bulk index operations - api_response = api_instance.bulk(body) + # Insert index operations + indexApi.insert({"index": "test", "id": 1, "doc" : {"title" : "Title 1"}}) + indexApi.insert({"index": "test", "id": 2, "doc" : {"title" : "Title 2"}}) + api_response = api_instance.insert(insert_request) pprint(api_response) except ApiException as e: print("Exception when calling IndexApi->bulk: %s\n" % e)