mirror of
https://github.com/nasa/openmct.git
synced 2025-04-09 20:31:26 +00:00
[Search] ES Provider error checks
The elasticsearch provider returns an empty result when elasticsearch throws an error (probably a bad request). This prevents the aggregator from thinking that ES is loading infinitely.
This commit is contained in:
parent
7c89e4aa4a
commit
6e11941ae9
@ -33,7 +33,7 @@ define(
|
||||
// so hide them here.
|
||||
var ID = "_id",
|
||||
SCORE = "_score",
|
||||
DEFAULT_MAX_RESULTS = 999999;
|
||||
DEFAULT_MAX_RESULTS = 100;
|
||||
|
||||
/**
|
||||
* A search service which searches through domain objects in
|
||||
@ -165,6 +165,10 @@ define(
|
||||
}).then(function (rawResults) {
|
||||
// ...then process the data
|
||||
return processResults(rawResults, timestamp);
|
||||
}).catch(function (err) {
|
||||
// In case of error, return nothing. (To prevent
|
||||
// infinite loading time.)
|
||||
return {hits: [], total: 0};
|
||||
});
|
||||
} else {
|
||||
return {hits: [], total: 0};
|
||||
|
Loading…
x
Reference in New Issue
Block a user