[Search] Added wildcards to generic

Added wildcard support to the generic
search provider. In this case, wildcards
behave just like spaces.
This commit is contained in:
shale 2015-07-21 16:10:35 -07:00
parent 5f30249065
commit 739fa423c5
4 changed files with 9 additions and 5 deletions

View File

@ -27,7 +27,7 @@
define(function () {
"use strict";
var INITIAL_LOAD_NUMBER = 5,
var INITIAL_LOAD_NUMBER = 20,
LOAD_INCREMENT = 5;
function SearchController($scope, $timeout, searchService) {

View File

@ -186,7 +186,6 @@ define(
* Notes:
* * The order of the results is from highest to lowest score,
* as elsaticsearch determines them to be.
* * Wildcards are supported.
* * Fuzziness is used to produce more results that are still
* relevant. (All results within a certain edit distance.)
* * More search details at

View File

@ -182,7 +182,6 @@ define(
* (which are generated by splitting the input at spaces).
* * Scores are higher for matches that have more than one of
* the terms as substrings.
* * Wildcards are not (yet?) supported.
*
* @param inputID the name of the ID property of the html text
* input where this funcion should find the search term

View File

@ -76,8 +76,14 @@
terms = terms.substring(0, terms.length - 1);
}
// Then split it at the spaces
terms = terms.split(' ');
// Then split it at spaces and asterisks
terms = terms.split(/ |\*/);
// Remove any empty strings from the terms
while (terms.indexOf('') !== -1) {
terms.splice(terms.indexOf(''), 1);
}
return terms;
}