gautamworah96 commented on a change in pull request #138: URL: https://github.com/apache/lucene/pull/138#discussion_r641822305
########## File path: lucene/facet/src/java/org/apache/lucene/facet/DrillDownQuery.java ########## @@ -170,15 +184,43 @@ private BooleanQuery getBooleanQuery() { return bq.build(); } - Query getBaseQuery() { + /** + * Returns the internal baseQuery of the DrillDownQuery + * + * @return The baseQuery used on initialization of DrillDownQuery + */ + public Query getBaseQuery() { return baseQuery; } - Query[] getDrillDownQueries() { + /** + * Returns the dimension queries added either via {@link #add(String, Query)} or {@link + * #add(String, String...)} + * + * @return The array of dimQueries + */ + public Query[] getDrillDownQueries() { + if (isAnyDimQueryDirty == false) { + // returns previously built dimQueries + Query[] builtDimQueriesCopy = new Query[builtDimQueries.size()]; + return builtDimQueries.toArray(builtDimQueriesCopy); + } Query[] dimQueries = new Query[this.dimQueries.size()]; for (int i = 0; i < dimQueries.length; ++i) { - dimQueries[i] = this.dimQueries.get(i).build(); + if (isDimQueryDirty.get(i) == true) { Review comment: Hmmm. That makes sense. I've implemented a `Set<int indexes of dims that need to be rebuilt> ` approach in the next commit -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org