Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search: Allow to specify script fields to be loaded #221

Closed
kimchy opened this issue Jun 14, 2010 · 1 comment

Comments

@kimchy
Copy link
Member

commented Jun 14, 2010

Script fields are basically scripts that a evaluated and returned per hit, two nice benefits is the fact that the field does not have to be stored, and a custom value can be returned (note, they probably make sense on numeric fields and on not analyzed fields).

A sample:

{
    "query" : {
        ...
    },
    "script_fields" : {
        "test1" : {
            "script" : "doc['my_field_name'].value * 2"
        },
        "test2" : {
            "script" : "doc['my_field_name'].value * factor",
            "params" : {
                "factor"  : 2.0
            }
        }
    }
}
@kimchy

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2010

Search: Allow to specify script fields to be loaded, closed by 0a1bc87.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.