Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Sense: add indexed scripts and search templates
Browse files Browse the repository at this point in the history
  • Loading branch information
bleskes committed Nov 18, 2014
1 parent e4e631b commit 12130f9
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
7 changes: 7 additions & 0 deletions sense/app/kb/api_1_0/aggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ define(function () {
},
"field": "{field}",
"script": "_value",
"script_id": "",
"params": {},
"lang": "groovy"
},
Expand Down Expand Up @@ -88,6 +89,7 @@ define(function () {
},
"min_doc_count": 10,
"script": "_value",
"script_id": "",
"params": {},
"lang": "groovy",
// TODO: these also support regex - extend!
Expand Down Expand Up @@ -136,6 +138,7 @@ define(function () {
],
"keyed": { __one_of: [true, false]},
"script": "_value",
"script_id": "",
"params": {},
"lang": "groovy"
},
Expand All @@ -153,6 +156,7 @@ define(function () {
],
"keyed": { __one_of: [true, false]},
"script": "_value",
"script_id": "",
"params": {},
"lang": "groovy"
},
Expand All @@ -170,6 +174,7 @@ define(function () {
],
"keyed": { __one_of: [true, false]},
"script": "_value",
"script_id": "",
"params": {},
"lang": "groovy"
},
Expand Down Expand Up @@ -257,6 +262,7 @@ define(function () {
__any_of: []
},
"script": "_value",
"script_id": "",
"params": {},
"lang": "groovy",
"compression": 100
Expand All @@ -268,6 +274,7 @@ define(function () {
"precision_threshold": 100,
"rehash": true,
"script": "_value",
"script_id": "",
"params": {},
"lang": "groovy"
},
Expand Down
19 changes: 19 additions & 0 deletions sense/app/kb/api_1_0/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ define(function () {
},
data_autocomplete_rules: {
"script": "",
"script_id": "",
"lang": "groovy",
"params": {},
"doc": {},
Expand All @@ -145,5 +146,23 @@ define(function () {

});

api.addEndpointDescription('_put_script', {
methods: [ 'POST', 'PUT'],
patterns: [
"_scripts/{lang}/{id}",
"_scripts/{lang}/{id}/_create"
],
url_components: {
"lang": [
"groovy",
"expressions"
]
},
data_autocomplete_rules: {
"script": ""
}
});


}
});
1 change: 1 addition & 0 deletions sense/app/kb/api_1_0/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ define(["_"], function (_) {
"script": "_score * doc['f'].value"
},
"script": "",
"script_id": "",
"lang": "groovy",
"params": {

Expand Down
31 changes: 30 additions & 1 deletion sense/app/kb/api_1_0/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,38 @@ define(function () {
"_search/template"
],
data_autocomplete_rules: {
__scope_link: "_search"
"template": {
__one_of: [
{__scope_link: "_search"},
{ "file": "" },
{ "id": ""}
]
},
"params": {

}
}
});

api.addEndpointDescription('_get_delete_search_template', {
methods: ['GET', 'DELETE'],
patterns: [
"_search/template/{id}"
]
});

api.addEndpointDescription('_put_search_template', {
methods: ['PUT'],
patterns: [
"_search/template/{id}"
],
data_autocomplete_rules: {
"template": {
__scope_link: "_search"
}
}
});

};

});

0 comments on commit 12130f9

Please sign in to comment.