diff --git a/extensions/indexes/range/src/main/java/org/exist/indexing/range/RangeIndexWorker.java b/extensions/indexes/range/src/main/java/org/exist/indexing/range/RangeIndexWorker.java index 1f397c32407..c0c0374b4ab 100644 --- a/extensions/indexes/range/src/main/java/org/exist/indexing/range/RangeIndexWorker.java +++ b/extensions/indexes/range/src/main/java/org/exist/indexing/range/RangeIndexWorker.java @@ -518,7 +518,7 @@ private void write() { public NodeSet query(int contextId, DocumentSet docs, NodeSet contextSet, List qnames, AtomicValue[] keys, RangeIndex.Operator operator, int axis) throws IOException, XPathException { return index.withSearcher(searcher -> { List definedIndexes = getDefinedIndexes(qnames); - NodeSet resultSet = new NewArrayNodeSet(); + NodeSet resultSet = null; for (QName qname : definedIndexes) { Query query; String field = LuceneUtil.encodeQName(qname, index.getBrokerPool().getSymbols()); @@ -534,7 +534,12 @@ public NodeSet query(int contextId, DocumentSet docs, NodeSet contextSet, List