Skip to content

Commit

Permalink
Fix error when there are no results node includes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Hernandez committed Feb 14, 2024
1 parent 109743c commit 05130fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/khaki-windows-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'contexture-elasticsearch': patch
---

Fix error when there are no results node includes
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export let getRequestHighlightFields = (schema, node) => {
// TODO: `highlightOtherMatches` is an undocumented configuration value that we
// are currently using to work around performance issues when highlighting
// fields not included in the node.
if (!node.highlight?.highlightOtherMatches) {
if (!node.highlight?.highlightOtherMatches && _.isArray(node.include)) {
let subFields = getSchemaSubFields({
fields: _.pick(node.include, schema.fields),
})
Expand Down

0 comments on commit 05130fe

Please sign in to comment.