Elastic native script scoring

hello
i am using java native script and i want to find which word in document matched to my query
how can i access the words that match to my query ?