This version of the OpenSearch documentation is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

Get script language

The get script language API operation retrieves all supported script languages and their contexts.

Example request

  1. GET _script_language

copy

Example response

The GET _script_language request returns the available contexts for each language:

  1. {
  2. "types_allowed" : [
  3. "inline",
  4. "stored"
  5. ],
  6. "language_contexts" : [
  7. {
  8. "language" : "expression",
  9. "contexts" : [
  10. "aggregation_selector",
  11. "aggs",
  12. "bucket_aggregation",
  13. "field",
  14. "filter",
  15. "number_sort",
  16. "score",
  17. "terms_set"
  18. ]
  19. },
  20. {
  21. "language" : "mustache",
  22. "contexts" : [
  23. "template"
  24. ]
  25. },
  26. {
  27. "language" : "opensearch_query_expression",
  28. "contexts" : [
  29. "aggs",
  30. "filter"
  31. ]
  32. },
  33. {
  34. "language" : "painless",
  35. "contexts" : [
  36. "aggregation_selector",
  37. "aggs",
  38. "aggs_combine",
  39. "aggs_init",
  40. "aggs_map",
  41. "aggs_reduce",
  42. "analysis",
  43. "bucket_aggregation",
  44. "field",
  45. "filter",
  46. "ingest",
  47. "interval",
  48. "moving-function",
  49. "number_sort",
  50. "painless_test",
  51. "processor_conditional",
  52. "score",
  53. "script_heuristic",
  54. "similarity",
  55. "similarity_weight",
  56. "string_sort",
  57. "template",
  58. "terms_set",
  59. "trigger",
  60. "update"
  61. ]
  62. }
  63. ]
  64. }

Response fields

The request contains the following response fields.

FieldData typeDescription
types_allowedList of stringsThe types of scripts that are enabled, determined by the script.allowed_types setting. May contain inline and/or stored.
language_contextsList of objectsA list of objects, each of which maps a supported language to its available contexts.
language_contexts.languageStringThe name of the registered scripting language.
language_contexts.contextsList of stringsA list of all contexts for the language, determined by the script.allowed_contexts setting.