mirror of
https://github.com/nasa/openmct.git
synced 2025-03-23 12:35:48 +00:00
[Search] Removed name field form ES provider
Removed the name field from the ElasticSearch provider search query string, so now it will check all of the fields of the domain object (such as type).
This commit is contained in:
parent
bce56c53ed
commit
a7cd6d8807
@ -48,16 +48,6 @@ define(
|
||||
*/
|
||||
function ElasticsearchSearchProvider($http, objectService, ROOT) {
|
||||
|
||||
// Check to see if the input has any special options
|
||||
function isDefaultFormat(searchTerm) {
|
||||
// If the input has a property option, not default
|
||||
if (searchTerm.includes('name:') || searchTerm.includes('type:')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Add the fuzziness operator to the search term
|
||||
function addFuzziness(searchTerm, editDistance) {
|
||||
if (!editDistance) {
|
||||
@ -91,13 +81,8 @@ define(
|
||||
spaceIndex = searchTerm.indexOf(' ');
|
||||
}
|
||||
|
||||
if (isDefaultFormat(searchTerm)) {
|
||||
// Add fuzziness for completeness
|
||||
searchTerm = addFuzziness(searchTerm);
|
||||
|
||||
// Searching 'name' by default
|
||||
searchTerm = 'name:' + searchTerm;
|
||||
}
|
||||
// Add fuzziness for completeness
|
||||
searchTerm = addFuzziness(searchTerm);
|
||||
|
||||
//console.log('search term ', searchTerm);
|
||||
return searchTerm;
|
||||
|
Loading…
x
Reference in New Issue
Block a user