Example request

    The following retrieves the my-first-script stored script.

    Example response

    The GET _scripts/my-first-script request returns the following fields:

    1. "_id" : "my-first-script",
    2. "found" : true,
    3. "lang" : "painless",
    4. "source" : """
    5. int total = 0;
    6. total += doc['ratings'][i];
    7. return total;
    8. """
    9. }
    10. }

    Script object