mirror of
https://github.com/nasa/openmct.git
synced 2025-01-06 21:28: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
@ -27,7 +27,7 @@
|
|||||||
define(function () {
|
define(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var INITIAL_LOAD_NUMBER = 5,
|
var INITIAL_LOAD_NUMBER = 20,
|
||||||
LOAD_INCREMENT = 5;
|
LOAD_INCREMENT = 5;
|
||||||
|
|
||||||
function SearchController($scope, $timeout, searchService) {
|
function SearchController($scope, $timeout, searchService) {
|
||||||
|
@ -186,7 +186,6 @@ define(
|
|||||||
* Notes:
|
* 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.
|
* as elsaticsearch determines them to be.
|
||||||
* * Wildcards are supported.
|
|
||||||
* * Fuzziness is used to produce more results that are still
|
* * Fuzziness is used to produce more results that are still
|
||||||
* relevant. (All results within a certain edit distance.)
|
* relevant. (All results within a certain edit distance.)
|
||||||
* * More search details at
|
* * More search details at
|
||||||
|
@ -182,7 +182,6 @@ define(
|
|||||||
* (which are generated by splitting the input at spaces).
|
* (which are generated by splitting the input at spaces).
|
||||||
* * Scores are higher for matches that have more than one of
|
* * Scores are higher for matches that have more than one of
|
||||||
* the terms as substrings.
|
* the terms as substrings.
|
||||||
* * Wildcards are not (yet?) supported.
|
|
||||||
*
|
*
|
||||||
* @param inputID the name of the ID property of the html text
|
* @param inputID the name of the ID property of the html text
|
||||||
* input where this funcion should find the search term
|
* input where this funcion should find the search term
|
||||||
|
@ -76,8 +76,14 @@
|
|||||||
terms = terms.substring(0, terms.length - 1);
|
terms = terms.substring(0, terms.length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then split it at the spaces
|
// Then split it at spaces and asterisks
|
||||||
terms = terms.split(' ');
|
terms = terms.split(/ |\*/);
|
||||||
|
|
||||||
|
// Remove any empty strings from the terms
|
||||||
|
while (terms.indexOf('') !== -1) {
|
||||||
|
terms.splice(terms.indexOf(''), 1);
|
||||||
|
}
|
||||||
|
|
||||||
return terms;
|
return terms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user