I want to create a plugin that adds a new field to the document before it get indexed. In Solr there is a specific component for this purpose UpdateRequestProcessor.
Is there something similar for elasticsearch?
Although some rivers support scripting to modify documents that are going to be indexed, that would definitely slow indexing down and is not supported within elasticsearch itself.
Doing this work in the client side is the way to go.