From aa7b8739a4526dbf7c5237776dcb0bec198fa514 Mon Sep 17 00:00:00 2001 From: Pierre Romera Date: Fri, 25 Oct 2024 17:14:42 +0000 Subject: [PATCH] feat: only download root embedded docs --- src/store/modules/search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/modules/search.js b/src/store/modules/search.js index 94f8022ac6..15592cf3d7 100644 --- a/src/store/modules/search.js +++ b/src/store/modules/search.js @@ -422,7 +422,8 @@ function actionsBuilder(api) { }, searchRoots({ state, commit, getters }, raw) { const indices = state.indices.join(',') - const ids = compact(get(raw, 'hits.hits', []).map((hit) => hit._source.rootDocument)) + const embedded = get(raw, 'hits.hits', []).filter((hit) => hit._source.extractionLevel > 0) + const ids = embedded.map((hit) => hit._source.rootDocument) const source = ['contentType', 'contentLength', 'title', 'path'] return api.elasticsearch.ids(indices, ids, source) },