summaryrefslogtreecommitdiffstats
path: root/container-search-gui/src/main/resources/gui/editarea/edit_area/reg_syntax/yql.js
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-07-19 09:29:39 +0200
committerGitHub <noreply@github.com>2018-07-19 09:29:39 +0200
commitaaccad8be603b7727f3a5f7004624e18011bc21d (patch)
tree4872080dd1f6b7e08bcdc8121de2c778a16320ee /container-search-gui/src/main/resources/gui/editarea/edit_area/reg_syntax/yql.js
parent2a2ae52250c5cbcf2a83fb72e020343b59bb237f (diff)
parent91eba83e9a2f72b3d978293daf2667ad8bc5dba7 (diff)
Merge pull request #6419 from vespa-engine/henrhoi/rank-profiles-and-sources-in-configuration-file
henrhoi/rank-profiles-and-sources-in-configuration-file
Diffstat (limited to 'container-search-gui/src/main/resources/gui/editarea/edit_area/reg_syntax/yql.js')
-rwxr-xr-xcontainer-search-gui/src/main/resources/gui/editarea/edit_area/reg_syntax/yql.js31
1 files changed, 29 insertions, 2 deletions
diff --git a/container-search-gui/src/main/resources/gui/editarea/edit_area/reg_syntax/yql.js b/container-search-gui/src/main/resources/gui/editarea/edit_area/reg_syntax/yql.js
index e4e9cd3b32d..0a7dae862f3 100755
--- a/container-search-gui/src/main/resources/gui/editarea/edit_area/reg_syntax/yql.js
+++ b/container-search-gui/src/main/resources/gui/editarea/edit_area/reg_syntax/yql.js
@@ -1,6 +1,19 @@
/**
* Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
*/
+function getSources(bool){
+ var options = [];
+ if (window.CONFIG.hasOwnProperty("model_sources")){
+ var sources = window.CONFIG.model_sources;
+ for (i in sources){
+ option = [sources[i]];
+ options.push(option);
+ }
+ if (bool == true){options.push(["*"])}
+ }
+ return options;
+}
+
editAreaLoader.load_syntax["yql"] = {
'DISPLAY_NAME' : 'YQL'
,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'}
@@ -74,9 +87,23 @@ editAreaLoader.load_syntax["yql"] = {
['DESC','DESC'],['ASC','ASC'],['ALL','ALL'], ['GROUP','GROUP'],
['RANGE','RANGE'],['EACH','EACH'],['OUTPUT','OUTPUT'],
['SUM','SUM'],['LIMIT','LIMIT'],['OFFSET','OFFSET'],
- ['TIMEOUT','TIMEOUT'],
- ]
+ ['TIMEOUT','TIMEOUT']
+ ]
+ }
+ },
+ "sources": { // the name of this definition group. It's posisble to have different rules inside the same definition file
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
+ ,"possible_words_letters": "[a-zA-Z0-9_]+"
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+ ,"prefix_separator": " "
+ }
+ ,"CASE_SENSITIVE": false
+ ,"MAX_TEXT_LENGTH": 50 // the maximum length of the text being analyzed before the cursor position
+ ,"KEYWORDS": {
+ 'SOURCES' : getSources(true) ,
+ ',' : getSources(false)
}
}
+
}
};