Hi All,
I am trying to bulk insert data into elastic search batch wise(say 10 records at once). Out of these I am having one record which is invalid. The rest client is rolling back all the 10 records. I want to save the valid 9 records and fail only the 1 records. Can someone please help me to figure out a way to do this?
hi
I have another setup with the older version 6.x, using transport client, that actually saves the valid records within a batch of bulk insert, even if there is a failure record.
Whereas the similar code using 7.x with rest client does not do so, it doesn't save even the valid records. it rejects all the rows.
If it rejects all the rows it means that none of them are valid or that there is something wrong with your request. Check the bulk response for error messages.
hi
I am intentionally giving one row invalid out of 10, if i correct that row all the 10 records get inserted.
I want elastic search to insert the 9 valid rows, but it rejects all the rows.
The same data when I try in 6.x version with transport code it inserts the 9 records and the 1 invalid record is rejected.
What error is returned for the 9 records? What does the bulk request look like? Are you maybe using a document type which has been deprecated in ES 7.x? Are you maybe having mapping issues due to changes in ES 7.x?
What error message do you get if you index a single document wothout using bulk?
hi
thanks for the help. Got the problem. There are two things:
Field level validations, like improperly formed JSON field and so on.
duplicate data and other validations that happen once the data reaches elastic search server.
When doing batch processing, error of type one make the whole batch rollback or fail. Where as error type two persist valid data into elastic search server and elastic search server will give proper error messages to us.
My issue is solved
Thanks and regards
Santosh
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.