mirror of
https://github.com/lucky-sideburn/kubeinvaders.git
synced 2026-08-21 12:36:42 +00:00
17 lines
397 B
Python
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)
|
|
|