I have created a custom plugin implementing scriptengineservice and overrided runAsDouble method.But facing problem in fetching current document.
I used below code :-
LeafDocLookup doc = lookup.getLeafSearchLookup(leafReaderContext).doc();
Exception:-IndexOutOfBounds exception
Is there any better way to fetch current LeafDocLookup??