Skip to content

Commit

Permalink
Query strategy works on BooleanQuery with MatchAllDocs predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Benjamin committed Apr 26, 2024
1 parent 883f01a commit df37b1a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions jbrowse/src/org/labkey/jbrowse/JBrowseLuceneSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,13 @@ public class ForceMatchAllDocsCachingPolicy implements QueryCachingPolicy {

@Override
public boolean shouldCache(Query query) throws IOException {
if (query instanceof MatchAllDocsQuery) {
return true;
if (query instanceof BooleanQuery) {
BooleanQuery bq = (BooleanQuery) query;
for (BooleanClause clause : bq) {
if (clause.getQuery() instanceof MatchAllDocsQuery) {
return true;
}
}
}

return defaultPolicy.shouldCache(query);
Expand Down

0 comments on commit df37b1a

Please sign in to comment.