From 672fa74321a096a055a05e32a83a408d7a4be9e6 Mon Sep 17 00:00:00 2001 From: shale Date: Wed, 15 Jul 2015 16:46:33 -0700 Subject: [PATCH] [Search] Changed default max results Changed the default number of max results to be 100 results. --- .../search/res/templates/searchbar.html | 6 +----- platform/features/search/src/QueryService.js | 18 ++++-------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/platform/features/search/res/templates/searchbar.html b/platform/features/search/res/templates/searchbar.html index f93fd1cd84..c218ae7ea0 100644 --- a/platform/features/search/res/templates/searchbar.html +++ b/platform/features/search/res/templates/searchbar.html @@ -22,14 +22,10 @@
- - Search: - + ng-keyup="controller.search('searchbarinput')" />
diff --git a/platform/features/search/src/QueryService.js b/platform/features/search/src/QueryService.js index e7be704f69..67ef80be9d 100644 --- a/platform/features/search/src/QueryService.js +++ b/platform/features/search/src/QueryService.js @@ -44,7 +44,7 @@ define( * @constructor */ function QueryService($http, objectService, ROOT) { - var DEFAULT_MAX_RESULTS = 2048; + var DEFAULT_MAX_RESULTS = 100; /////////////// The following is for non-Elastic Search ///////////////// @@ -162,14 +162,6 @@ define( return true; } - // Add wildcards to the font and end of each subterm - // Used by queryElasticsearch() - function addWildcards(searchTerm) { - return searchTerm.split(' ').map(function (s) { - return '*' + s + '*'; - }).join(' '); - } - // Add the fuzziness operator to the search term // Used by queryElasticsearch() function addFuzziness(searchTerm, editDistance) { @@ -180,7 +172,6 @@ define( return searchTerm.split(' ').map(function (s) { return s + '~' + editDistance; }).join(' '); - //searchTerm + '~' + editDistance; } // Currently specific to elasticsearch @@ -196,13 +187,12 @@ define( if (isDefaultInput(searchTerm)) { // Add fuzziness for completeness - searchTerm = addFuzziness(searchTerm, 1); + searchTerm = addFuzziness(searchTerm, 2); // Searching 'name' by default searchTerm = 'name:' + searchTerm; } - //console.log('processed search term ', searchTerm); return searchTerm; } @@ -250,7 +240,7 @@ define( * Searches through the filetree for domain objects using a search * term. This is done through querying elasticsearch. * Notes: - * * The order of the results is from highest to lowest score, + * * The order of the results is from highest to lowest score, * as elsaticsearch determines them to be. * * Folders are not included in the results. * * Wildcards are supported. @@ -266,7 +256,7 @@ define( */ function queryElasticsearch(inputID, maxResults) { var searchTerm; - + // Check to see if the user provided a maximum // number of results to display if (!maxResults) {