mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 08:48:28 +00:00
[Search] More robust search
Seach now searches using terms, which are the domain objects' names split at the spaces. Still does not work with any substring, must be space separated. Not case sensitive.
This commit is contained in:
parent
b9f8f6e33d
commit
5892594668
@ -92,14 +92,16 @@ define(function () {
|
|||||||
// Get the data...
|
// Get the data...
|
||||||
return $http({
|
return $http({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: ROOT + "/_search",
|
url: ROOT + "/_search/?q=name:'" + searchTerm + "'"
|
||||||
|
/*,
|
||||||
data: {
|
data: {
|
||||||
query: {
|
query: {
|
||||||
term : {
|
term : {
|
||||||
name: searchTerm
|
_source: { name : "test123" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}).then(function (rawResults) {
|
}).then(function (rawResults) {
|
||||||
// ...then process the data
|
// ...then process the data
|
||||||
var results = rawResults.data.hits.hits,
|
var results = rawResults.data.hits.hits,
|
||||||
@ -107,7 +109,7 @@ define(function () {
|
|||||||
ids = [],
|
ids = [],
|
||||||
i;
|
i;
|
||||||
|
|
||||||
//console.log('raw results', rawResults);
|
console.log('raw results', rawResults);
|
||||||
|
|
||||||
// Get the result objects' IDs
|
// Get the result objects' IDs
|
||||||
for (i = 0; i < resultsLength; i += 1) {
|
for (i = 0; i < resultsLength; i += 1) {
|
||||||
@ -132,7 +134,7 @@ define(function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log('final output', output);
|
console.log('final output', output);
|
||||||
return output;
|
return output;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user