elasticsearch-bulk

Parent specification in elasticsearch for first node

纵饮孤独 提交于 2019-12-12 04:05:24
问题 I am using the _bulk api for indexing my data. I have a parent field for every document except the first document. Normally my documents will have the following meta-data: {"index":{"_id":"11111", "parent": "00000"}} What should I specify in the parent field for the first document. Should I leave the parent field blank? {"index":{"_id":"00000", "parent": ""}} Or should I not include the parent field at all? {"index":{"_id":"00000"}} 回答1: You simply don't include the parent property at all in

Elasticsearch bulk API returning 400 error in Java

时光毁灭记忆、已成空白 提交于 2019-12-12 03:32:45
问题 I tried a lot of things to check why is it showing a malformed request. Refer to this question to properly format my request body. Parent specification in elasticsearch for first node Here is my code. I am using Unirest API to send requests. In the commented part of the code the request body is stored. When using the file content and sending a request independently using POSTman, I am able to achieve my target. import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter;