diff --git a/libs/search.js b/libs/search.js index 37d33ecf..093811ce 100644 --- a/libs/search.js +++ b/libs/search.js @@ -114,8 +114,8 @@ module.exports = { AND: { 'entryPath': [entryPath] } }] })).then((results) => { - if (results.totalHits > 0) { - let delIds = _.map(results.hits, 'id') + if (results && results.length > 0) { + let delIds = _.map(results, 'id') return self._si.delAsync(delIds) } else { return true