[ 
https://issues.apache.org/jira/browse/LUCENE-9956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17344924#comment-17344924
 ] 

Gautam Worah commented on LUCENE-9956:
--------------------------------------

Here is why I need just the baseQuery and drill down queries from a 
{{DrillDownQuery}} object.
 I have an initial {{DrillDownQuery}} that I construct by parsing the user's 
{{BooleanQuery}} and add custom {{subQuery}} s to it using the {{add(String 
dim, Query subQuery)}} API.

Then later on, I try to optimize the base {{BooleanQuery}} (remove some terms) 
and create a new {{DrillDownQuery}} object and add the original \{{subQuery}} s 
back.

Can we make rewrite() do this? Yes

Pros: Does not expose the {{baseQuery}} and limits the access 
Cons: 
 1. {{rewrite}} returns a so to say combined form of the {{DrillDownQuery}}. 
The user will have to again parse the first BQ clause and get the {{baseQuery}} 
then parse all the remaining clauses and get the \{{subQuery}}s. 
2. Using the {{rewrite}} function to get the {{baseQuery}} is a bit non 
intuitive

> Make getBaseQuery API from DrillDownQuery public 
> -------------------------------------------------
>
>                 Key: LUCENE-9956
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9956
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/facet
>    Affects Versions: main (9.0)
>            Reporter: Gautam Worah
>            Priority: Trivial
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> It would be great if users could access the baseQuery of a DrillDownQuery. I 
> think this can be useful for folks who want to access/test the clauses of a 
> BooleanQuery (for example) after they've already wrapped it into a 
> DrillDownQuery.
>  
>  Currently the {{Query getBaseQuery()}} method is package private by default.
> If this proposed change does not make sense, or if this change breaks the 
> semantic of the class, I am happy to explore other ways of doing this!
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to