Ok, thanks. My general use case is wanting to do a keyword search but then re-weighting those results by a similarity score (specifically, by a function of the similarity score). It actually seems like I can use function score to sort of do what I want with the current implementation, but in a kind of roundabout way compared to the simplicity of using a Painless script.