Logging in an ElasticSearch plugin

Hello everyone,

I'm working on a simple ElasticSearch plugin that computes a score for a document. What I would love to do is to be able to debug the plugin so that I can write to the standard output which document is being handled by the plugin, so that I can see for document X -> score Y has been computed.

I have a LeafReaderContext at my disposal in the plugin, but so far I haven't been able to find any documentation that provides me on how to read the "id" from the document so far, which I could use to log interesting info. In an ElasticSearch plugin you also have the "int docId" at your disposal but that's an internal ID, not one that is exposed in a way you can use it to identify the document.

Any help towards being able to output the document ID in an ElasticSearch plugin, or a way to help debug is very much appreciated!

Have a good one!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.