Has Child sorting problem

Hi there,

in our project we are using hasChild sorting which is exactly by the book:

    "query": {
        "has_child" : {
            "type" : "blog_tag",
            "score_mode" : "max",
            "query" : {
                "function_score" : {
                    "script_score": {
                        "script": "_score * doc['click_count'].value"

The problem is that when I have "score_mode" it returns the following error:

"reason":{"type":"script_exception","reason":"failed to run inline script ["_score * doc['click_count'].value] using lang [groovy]","caused_by":{"type":"missing_property_exception","reason":"No such property:

Getting rid of the "score_mode" will show results that are not sorted. Does anyone have any idea what could be the problem?
Thanks in advance.