mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +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:
@ -33,7 +33,7 @@ define(
|
|||||||
// so hide them here.
|
// so hide them here.
|
||||||
var ID = "_id",
|
var ID = "_id",
|
||||||
SCORE = "_score",
|
SCORE = "_score",
|
||||||
DEFAULT_MAX_RESULTS = 999999;
|
DEFAULT_MAX_RESULTS = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A search service which searches through domain objects in
|
* A search service which searches through domain objects in
|
||||||
@ -165,6 +165,10 @@ define(
|
|||||||
}).then(function (rawResults) {
|
}).then(function (rawResults) {
|
||||||
// ...then process the data
|
// ...then process the data
|
||||||
return processResults(rawResults, timestamp);
|
return processResults(rawResults, timestamp);
|
||||||
|
}).catch(function (err) {
|
||||||
|
// In case of error, return nothing. (To prevent
|
||||||
|
// infinite loading time.)
|
||||||
|
return {hits: [], total: 0};
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return {hits: [], total: 0};
|
return {hits: [], total: 0};
|
||||||
|
Reference in New Issue
Block a user