-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ScriptQuery
Eliran Moyal edited this page Dec 30, 2015
·
2 revisions
If you want to filter your documents according to scripts you can do it!
read about it here
- 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')
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')