{
"name": "foo",
"engine": {
"version": "v1"
},
"defaults": {
"app": "id"
"feed": "id",
"storage": "id",
"user": "id",
"stream": "id",
},
"callback": {
"success": "url"
"error": "url"
},
"trigger": {
"public_feed": {
"id": "ANY | ID"
"on_add": true,
"on_delete": true,
"on_update": true,
},
"user": {
"id": "ANY | ID"
"on_relation": true,
"on_skip": true,
},
"schedule": {
"daily": true,
"monthly": true,
}
},
"steps" : {
"search": {
"search1": {
"search": function (api) {
return {
"key1": {'name':'foo', 'age':22, 'location': 'london'},
"key2": {'name':'foo', 'age':45, 'location': 'paris'},
}
},
"select": function (api, key, value) {
emit(key, {'age': value['age']})
},
"reduce": function (api, key, value){
emit(key, sum(value))
},
"sort": function (api){
'age': -1
}
},
"search2": {
"search": function () {
x = in('search1').range(0, 9)
out(x)
},
"select": function (),
"reduce": function (),
"sort": function ()
},
"searchN": {
"search": function (),
"select": function (),
"reduce": function (),
"sort": function ()
}
},
"save": {
"action": "method_bar",
"lifetime": "5m"
},
"notify": "method_bar"
},
"controllers": {
"method_foo": function(key, value, api, [storage, user, stream]) {},
"method_bar": function(key, value, api, [storage, user, stream]) {},
"method_foobar": function(key, value, api, [storage, user, stream]) {},
}
}
Following #4
Elasticfeed DSL Overview (Domain-Specific-Language)
Golangwritten with embeddedjavascriptas syntaxsyntax
parser input
javascriptsyntaxJSONscenario templatekeywords
types
functions
Plugins
GLOBAL Objects
iterators
casting
Examples
Testing