scripting.asciidoc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. [[modules-scripting]]
  2. = Scripting
  3. [partintro]
  4. --
  5. With scripting, you can evaluate custom expressions in {es}. For example, you
  6. could use a script to return "script fields" as part of a search request or
  7. evaluate a custom score for a query.
  8. The default scripting language is <<modules-scripting-painless, `Painless`>>.
  9. Additional `lang` plugins enable you to run scripts written in other languages.
  10. Everywhere a script can be used, you can include a `lang` parameter
  11. to specify the language of the script.
  12. [float]
  13. == General-purpose languages
  14. These languages can be used for any purpose in the scripting APIs,
  15. and give the most flexibility.
  16. [cols="<,<,<",options="header",]
  17. |=======================================================================
  18. |Language
  19. |Sandboxed
  20. |Required plugin
  21. |<<modules-scripting-painless, `painless`>>
  22. |yes
  23. |built-in
  24. |=======================================================================
  25. [float]
  26. == Special-purpose languages
  27. These languages are less flexible, but typically have higher performance for
  28. certain tasks.
  29. [cols="<,<,<,<",options="header",]
  30. |=======================================================================
  31. |Language
  32. |Sandboxed
  33. |Required plugin
  34. |Purpose
  35. |<<modules-scripting-expression, `expression`>>
  36. |yes
  37. |built-in
  38. |fast custom ranking and sorting
  39. |<<search-template, `mustache`>>
  40. |yes
  41. |built-in
  42. |templates
  43. |<<modules-scripting-engine, `java`>>
  44. |n/a
  45. |you write it!
  46. |expert API
  47. |=======================================================================
  48. [WARNING]
  49. .Scripts and security
  50. =================================================
  51. Languages that are sandboxed are designed with security in mind. However, non-
  52. sandboxed languages can be a security issue, please read
  53. <<modules-scripting-security, Scripting and security>> for more details.
  54. =================================================
  55. --
  56. include::scripting/using.asciidoc[]
  57. include::scripting/fields.asciidoc[]
  58. include::scripting/security.asciidoc[]
  59. include::scripting/painless.asciidoc[]
  60. include::scripting/expression.asciidoc[]
  61. include::scripting/engine.asciidoc[]