Which way to save into an other index on elasticsearh the result of some operation make during indexation

StackOverflow https://stackoverflow.com/questions/18488042

Question

I need to save some data which be the result of some operation make during indexation operation (analyzer or other way) into an other elasticsearch index. For example, i've got :

  • Doc 1.1; time 2s
  • Doc 1.2; time 5s
  • Doc 2.1; time 3s
  • Doc 2.2; time 7s

I need to save the result of 1.1 - 1.2 for example (here the result is 2 - 5 => 3), in other index (for performance). Of course this is a simplification, there are some other field. But what is the best manner for do this.

Was it helpful?

Solution

I think you'll have to wrap all those indexation in your own code. Just index your docs, and then, if this is successfull, compute the others doc from them or from the index response and index them in your second index.

I am not sure I undestood the question, but if that was it, I'm pretty sure (though I could be wrong) that ES cannot do those seconds indexations by itself, no matter how magical it is.

Good luck.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top