Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class WorkerThread implements Runnable {
SearchHit hit;
public WorkerThread(SearchHit hit){
this.hit = hit;
}
@Override
public void run() {
//Handle the hit...
String srcIP = "";
String ES_ID = this.hit.getId();
String ES_INDEX = this.hit.getIndex();
System.out.println("Processing "+ES_ID);
Map __source = this.hit.getSource();
srcIP = (String) __source.get("SourceAddress");
//add destination tuples
try {
App.addToBulkRequest(new UpdateRequest().index(ES_INDEX).type(this.hit.getType()).id(ES_ID)
.doc(jsonBuilder()
.startObject()
.field("bulk_index", "true")
.endObject())
);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment