Script

case class Script(script: String, lang: Option[String], scriptType: ScriptType, params: Map[String, Any], options: Map[String, String], paramsRaw: Map[String, String])

A script that can be used in queries (ex: Painless scripting).

Value parameters:
lang

the language of the script (defaults to Painless)

options

the options for this script

params

the parameters of the script which will be automatically-serialized

paramsRaw

the parameters of the script which are already serialized

script

the script source

scriptType

the type of script (see ScriptType.Source)

Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def lang(lang: String): Script

Sets the script language.

Sets the script language.

def param(name: String, value: Any): Script

Sets a parameter that will be automatically-serialized before sending to Elasticsearch.

Sets a parameter that will be automatically-serialized before sending to Elasticsearch.

Value parameters:
name

the parameter key

value

the parameter value as a primitive type (Double, BigInt, Seq, Map, etc.); for all the primitive types supported, see com.sksamuel.elastic4s.json.XContentBuilder#autofield; for sending objects, see paramRaw and paramObject

def paramObject[T](name: String, value: T)(implicit serializer: ParamSerializer[T]): Script

Sets a parameter with an object value, which is serialized with the given implicit serializer.

Sets a parameter with an object value, which is serialized with the given implicit serializer.

Type parameters:
T

object's type

Value parameters:
name

the parameter key

serializer

the parameter serializer (see ParamSerializer)

value

the parameter value

def paramRaw(name: String, value: String): Script

Sets an already-serialized parameter.

Sets an already-serialized parameter.

Value parameters:
name

the parameter key

value

the parameter serialized value as a string

def params(first: (String, Any), rest: (String, AnyRef)*): Script
def params(seq: Seq[(String, Any)]): Script
def params(map: Map[String, Any]): Script
def paramsObject[T](first: (String, T), rest: (String, T)*)(implicit serializer: ParamSerializer[T]): Script
def paramsObject[T](seq: Seq[(String, T)])(implicit serializer: ParamSerializer[T]): Script
def paramsObject[T](map: Map[String, T])(implicit serializer: ParamSerializer[T]): Script
def paramsRaw(first: (String, String), rest: (String, String)*): Script
def paramsRaw(seq: Seq[(String, String)]): Script
def paramsRaw(map: Map[String, String]): Script
def scriptType(tpe: String): Script
def scriptType(scriptType: ScriptType): Script

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product