From 0de7c6324dc112e51bfeaf6b207a312bdfbceaef Mon Sep 17 00:00:00 2001 From: Antonio Verardi Date: Fri, 25 Jul 2014 13:52:01 -0700 Subject: [PATCH 1/2] Irc_log low score --- js/controllers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/controllers.js b/js/controllers.js index b92bd4d..1f2c145 100755 --- a/js/controllers.js +++ b/js/controllers.js @@ -333,7 +333,7 @@ function SearchCtrl($scope, $sce, $routeParams, $location, elastic, configuratio executedQuery = constructQuery(tree); } else if ($scope.search.simple && $scope.search.simple.length > 0) { - executedQuery = {"query_string": {"query": $scope.search.simple, "fields": ["_all"], "use_dis_max": true}}; + executedQuery = {"function_score": {"query": {"query_string": {"query": $scope.search.simple, "fields": ["_all"], "use_dis_max": true}},"functions":[{"filter": {"type": {"value": "irc_log"}}, "boost_factor": 0.25}]}}; } else { executedQuery = {"matchAll": {}}; } From 40cfa86a5520dbf3fb1c29464745f9e9a6130872 Mon Sep 17 00:00:00 2001 From: Antonio Verardi Date: Fri, 25 Jul 2014 14:05:38 -0700 Subject: [PATCH 2/2] String for functions in simple query --- js/controllers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/controllers.js b/js/controllers.js index 1f2c145..38a0a5c 100755 --- a/js/controllers.js +++ b/js/controllers.js @@ -333,7 +333,8 @@ function SearchCtrl($scope, $sce, $routeParams, $location, elastic, configuratio executedQuery = constructQuery(tree); } else if ($scope.search.simple && $scope.search.simple.length > 0) { - executedQuery = {"function_score": {"query": {"query_string": {"query": $scope.search.simple, "fields": ["_all"], "use_dis_max": true}},"functions":[{"filter": {"type": {"value": "irc_log"}}, "boost_factor": 0.25}]}}; + var functions = [{"filter": {"type": {"value": "irc_log"}}, "boost_factor": 0.25}]; + executedQuery = {"function_score": {"query": {"query_string": {"query": $scope.search.simple, "fields": ["_all"], "use_dis_max": true}},"functions":functions}}; } else { executedQuery = {"matchAll": {}}; }