Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Nov 1, 2024
1 parent 960256f commit 689c3f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 689c3f9

Please sign in to comment.