Skip to content

ScriptQuery

Eliran Moyal edited this page Dec 30, 2015 · 2 revisions

Script Query

If you want to filter your documents according to scripts you can do it!
read about it here

how to use?

  • The syntax is script('yourScript') / script('yourScript','param1'=value1,..,'paramN'=valueN)
  • examples
SELECT insert_time FROM elast*/online where script('doc["insert_time"].date.hourOfDay==16')
SELECT insert_time FROM elast*/online where script('doc[field].date.hourOfDay==x','x'=16,'field'='insert_time')

Files or Indexed script support

Importent! this feature only works on elastic2.x plugin versions.
Just add the 'script_type'='file' or 'script_type'='indexed' to your parameters

Example:

SELECT insert_time FROM elast*/online where script('hour','x'=16,'field'='insert_time','script_type'='file')
Clone this wiki locally