Skip to content
Advertisement

Bulk upload CSV file into Elasticsearch using JavaAPI

I want to bulk upload the csv file into Elasticsearch using JAVA API (without using logstash).

Elasticsearch version – 6.6

I have tried the below program using Jackson format to get source Map for IndexRequest. Because I can’t predefined the POJO variables. So I used dynamic Map from CSV file

JavaScript

I got the below exception while running the program

JavaScript

When I try to insert the same above indexrequest its working fine.

JavaScript

Please help to fix the issue in java program. Thanks in advance

Advertisement

Answer

Before Elasticsearch version 7 you have to specify a type with your Indexrequest. It is recommended to use the type “_doc”.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement