From 503811f69c0f802ebbf4e2c37073aec49196bde0 Mon Sep 17 00:00:00 2001 From: shale Date: Tue, 14 Jul 2015 10:45:51 -0700 Subject: [PATCH] [Search] Search behaves as expected Seaching any substring of a domain object title now will give the domian object as a search result. Still not case sensitive. Empty string will return all results. Special characters do not search correctly. Still has result number cap. --- platform/features/search/src/SearchController.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/platform/features/search/src/SearchController.js b/platform/features/search/src/SearchController.js index 303c6eac07..b1988a1b18 100644 --- a/platform/features/search/src/SearchController.js +++ b/platform/features/search/src/SearchController.js @@ -89,19 +89,14 @@ define(function () { searchTerm = document.getElementById("searchinput").value; } + // Process search term + // Put wildcards on front and end to allow substring behavior + searchTerm = '*' + searchTerm + '*'; + // Get the data... return $http({ method: "GET", - url: ROOT + "/_search/?q=name:'" + searchTerm + "'" - /*, - data: { - query: { - term : { - _source: { name : "test123" } - } - } - } - */ + url: ROOT + "/_search/?q=name:" + searchTerm }).then(function (rawResults) { // ...then process the data var results = rawResults.data.hits.hits,