mirror of
https://github.com/nasa/openmct.git
synced 2025-01-02 11:26:42 +00:00
[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:
parent
5f30249065
commit
739fa423c5
platform/features/search/src
controllers
providers
workers
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user