Is it possible to use ScoreFunctionBuilder/ScoreFunction plugin within script_score query?

Hi,

I have developed a custom ScoreFunctionBuilder / ScoreFunction as part of Elasticsearch SearchPlugin. I now can use this function "my_function" within an Elasticsearch query as part of a function_score query like:

{
	"query": {
		"function_score": {
			"query": {
				"match_all": {}
			},
			"functions": [
				{
					"my_function": {
						"myarg": "123"
					}
				}
			]
		}
	}
}

This works like a charm, so far so good. But should it also be possible to use this custom function in a script within a script_score query? The following does not work, the function is not recognized:

{
	"query": {
		"script_score": {
			"query": {
				"match_all": {}
			},
			"script": {
				"source": "my_function('123')"
			}
		}
	}
}

Thanks,
Maarten