How to get the matched terms to a doc in script score,

how to get the matched terms to a doc in script score,
if there is not any way, may i do this by implementing any plugin my self?