javaelasticsearchlogstashlogstash-filter

Logstash using ruby filter, How are ElasticSearch id controll?


I use Java ElasticSearch api.
One search, average search result 17,000,000 data Therefore i ElasticSearch api used a scrolling method.

One ElasticSearch data update is required. and update use needs '_id'. However, the search result source does not include '_id'.

And I thought of a way !

"I want to use the Logstash Filter to include '_id' in the ElasticSearch Source."

but, i don't know way ElasticSearch source include '_id' :( ...

Help me !

if other way, Please let me know.


Solution

  • You can get the _id of a hit in Java API using SearchHit.getId(): https://static.javadoc.io/org.elasticsearch/elasticsearch/6.0.0/org/elasticsearch/search/SearchHit.html#getId--.