谢谢@JinLee和@NishantSaini的帮助。我想记录一下我所做的。
首先,添加
/_bulk端点。因此,API调用现在为:
POST http://localhost:9200/myindex/mytype/_bulk。
现在将
Content-Type标题设置为
application/x-ndjson
然后身体必须是这样的:
{"index":{}}{"message":"message1"}{"index":{}}{"message":"message2"}现在一切正常!

谢谢@JinLee和@NishantSaini的帮助。我想记录一下我所做的。
首先,添加
/_bulk端点。因此,API调用现在为:
POST http://localhost:9200/myindex/mytype/_bulk。
现在将
Content-Type标题设置为
application/x-ndjson
然后身体必须是这样的:
{"index":{}}{"message":"message1"}{"index":{}}{"message":"message2"}现在一切正常!