Percolate and store the result

Hi everyone,

I'm having a difficulty with storing the percolation result. The idea
is to match the document against some queries (percolate), and push
the result of this percolation into the document field.

However, for the moment I only see it possible using 2 queries - first
to get percolation results and second to index the document.

Could you please share your experience on how to do this or point me
in the right direction?

Thanks!