String as parameter in script score


I like to rescore a minor set of results with script score written in groovy
As scoring algorithm I take the levenshtein distance, so I need to have access to the query string.

How can I realize that because it's not possible to take a string as a parameter for scipt score.

Thanks a lot for your help.