Skip to content

Commit

Permalink
fix: bug
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed May 17, 2024
1 parent dae5371 commit e332cfc
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ export const getSearchBasedItems = async ({
requestBodies.push({ index: elasticDocumentsIndex }, semBody);
}

const bdy = await elasticsearchClient.msearch<any>({ body: requestBodies });
const {
responses: [esResponse = {}, semResponse = {}],
}: any = await elasticsearchClient.msearch({ body: requestBodies });

const semanticHits = bdy.took[1].hits.hits;
const fullTextHits = bdy.took[0].hits.hits;
const { hits: { hits: semanticHits } = { hits: [] } } = semResponse;
const { hits: { hits: fullTextHits } = { hits: [] } } = esResponse;

return (
mergePipe(fullTextHits, semanticHits, MAX_RESULTS)
Expand Down

0 comments on commit e332cfc

Please sign in to comment.