From 52fab60cda6de0aa6efae5c5d1fb013554bc1fc0 Mon Sep 17 00:00:00 2001 From: keyan Date: Wed, 28 Sep 2022 11:28:53 -0500 Subject: [PATCH] fix missing search fields --- api/resolvers/item.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index 5afa557b..e329d687 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -529,8 +529,9 @@ export default { } // return highlights - const items = sitems.body.hits.hits.map(e => { - const item = e._source + const items = sitems.body.hits.hits.map(async e => { + // this is super inefficient but will suffice until we do something more generic + const item = await getItem(parent, { id: e._source.id }, { me, models }) item.searchTitle = (e.highlight.title && e.highlight.title[0]) || item.title item.searchText = (e.highlight.text && e.highlight.text[0]) || item.text