Elastic Percentile Rank

I need to calculate the percentile rank of my client in a set of data when i apply a filter. For Instance when i apply a particular filter , my client might not fall in that dataset , but still i want my client to be included in the dataset and find the percentile of where he stands . In-short is it possible t override the percentile calculation of elastic search using scripting . Any suggestion on that front would be great.

I do not fully understand the requirement. Do you want to include all data in the percentile calculation independent from the filter used in the query?

Thanks for your reply @spinscale.

Yes that is one of the requirement. As Elastic calculates the persentile by applying filter on the data, in one of the negative scenario case it is showing wrong percentile value over there. Can you please help ?