mirror of
https://github.com/nasa/openmct.git
synced 2025-05-09 12:03:21 +00:00
[Search] Search behaves as expected
Seaching any substring of a domain object title now will give the domian object as a search result. Still not case sensitive. Empty string will return all results. Special characters do not search correctly. Still has result number cap.
This commit is contained in:
parent
5892594668
commit
503811f69c
@ -89,19 +89,14 @@ define(function () {
|
|||||||
searchTerm = document.getElementById("searchinput").value;
|
searchTerm = document.getElementById("searchinput").value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Process search term
|
||||||
|
// Put wildcards on front and end to allow substring behavior
|
||||||
|
searchTerm = '*' + searchTerm + '*';
|
||||||
|
|
||||||
// Get the data...
|
// Get the data...
|
||||||
return $http({
|
return $http({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: ROOT + "/_search/?q=name:'" + searchTerm + "'"
|
url: ROOT + "/_search/?q=name:" + searchTerm
|
||||||
/*,
|
|
||||||
data: {
|
|
||||||
query: {
|
|
||||||
term : {
|
|
||||||
_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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user