You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/05/16 23:39:41 UTC

[GitHub] [lucene] gautamworah96 commented on a change in pull request #138: LUCENE-9956: Make getBaseQuery, getDrillDownQueries API from DrillDownQuery public

gautamworah96 commented on a change in pull request #138:
URL: https://github.com/apache/lucene/pull/138#discussion_r633155578



##########
File path: lucene/facet/src/java/org/apache/lucene/facet/DrillDownQuery.java
##########
@@ -170,11 +170,22 @@ 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() {
     Query[] dimQueries = new Query[this.dimQueries.size()];

Review comment:
       So this ties back into why we use a `BooleanQuery.Builder` and not a `BooleanQuery` for storing `dimQueries`. IMO the reason behind this is so that you can call `public void add(String dim, Query subQuery)` multiple times with the same `dim` and keep on adding `subQueries`. This is possible because you are just adding `subQueries` with `Occur.SHOULD` clauses to the `Builder`. However, this is not possible with an already built  `BooleanQuery`




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org