From e4397f3a248fd3284affad4358d827cf575961d9 Mon Sep 17 00:00:00 2001 From: Bharathwaj G Date: Tue, 27 Feb 2024 18:48:12 +0530 Subject: [PATCH] fix for no match in star tree Signed-off-by: Bharathwaj G --- .../index/codec/freshstartree/query/StarTreeFilter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/index/codec/freshstartree/query/StarTreeFilter.java b/server/src/main/java/org/opensearch/index/codec/freshstartree/query/StarTreeFilter.java index 10219249e3bed..71b6b4947321d 100644 --- a/server/src/main/java/org/opensearch/index/codec/freshstartree/query/StarTreeFilter.java +++ b/server/src/main/java/org/opensearch/index/codec/freshstartree/query/StarTreeFilter.java @@ -96,10 +96,13 @@ public StarTreeFilter( // 1706268600 / (60*60*1000) * (60*60*1000) public DocIdSetIterator getStarTreeResult() throws IOException { StarTreeResult starTreeResult = traverseStarTree(); - logger.info("Matched docs in star tree : {}" , starTreeResult.numOfMatchedDocs); + //logger.info("Matched docs in star tree : {}" , starTreeResult.numOfMatchedDocs); List andIterators = new ArrayList<>(); andIterators.add(starTreeResult._matchedDocIds.build().iterator()); DocIdSetIterator docIdSetIterator = andIterators.get(0); + if(starTreeResult.maxMatchedDoc == -1) { + return docIdSetIterator; + } int docCount = 0; for (String remainingPredicateColumn : starTreeResult._remainingPredicateColumns) { // TODO : set to max value of doc values