[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:
slhale 2015-07-30 15:47:09 -07:00
parent 7c89e4aa4a
commit 6e11941ae9

View File

@ -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};