Files
2022-12-28 07:54:21 +01:00

17 lines
397 B
Python

import time
from elasticsearch import Elasticsearch
# Connect to the Elasticsearch cluster
es = Elasticsearch(["localhost"])
# Continuously index and delete documents
while True:
# Index a document
es.index(index="test-index", doc_type="test-type", id=1, body={"test": "test"})
# Delete the document
es.delete(index="test-index", doc_type="test-type", id=1)
time.sleep(1)