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

Michael McCandless commented on LUCENE-4750:
--------------------------------------------

bq. Mike, I'm migrating the patch to after the packages reorg, and I want to 
handle the nocommits.

Thanks Shai!

bq. Shouldn't rewrite() call res.rewrite()? We don't know what baseQuery will 
rewrite too...

This isn't actually necessary: IndexSearcher will call rewrite on whatever we 
return.

bq. Perhaps instead of keeping a List<Query> drillDownQueries, we can build the 
BQ on-the-fly in .add()? We can then use it in toString and rewrite directly, 
vs now that rewrite always creates a new BQ.

I think that's good?

bq. BTW, is that an error to not create a new BQ on every rewrite? I don't 
think so, but want to verify...

I don't think it's an error to not make a new Query on every rewrite.  I 
suppose there is some risk that an app might run the query while continuing to 
add drill downs in another thread ... but apps just shouldn't do that ...

That said ... I don't really like how toString shows impl details (eg, the 
$facet field name), vs eg just the CP/s of each drill-down, but I think that's 
pretty minor ...

bq. Oh, and if we do build the result BQ on the fly, it will make implementing 
equals() and hashCode() very simple ...

Good!
                
> Convert DrillDown to DrillDownQuery
> -----------------------------------
>
>                 Key: LUCENE-4750
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4750
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/facet
>            Reporter: Shai Erera
>            Assignee: Michael McCandless
>         Attachments: LUCENE-4750.patch
>
>
> DrillDown is a utility class for creating drill-down queries over a base 
> query and a bunch of categories. We've been asked to support AND, OR and AND 
> of ORs. The latter is not so simple as a static utility method though, so 
> instead we have some sample code ...
> Rather, I think that we can just create a DrillDownQuery (extends Query) 
> which takes a baseQuery in its ctor and exposes add(CategoryPath...), such 
> that every such group of categories is AND'ed with other groups, and 
> internally they are OR'ed. It's very similar to how you would construct a 
> BooleanQuery, only simpler and specific to facets.
> Internally, it would build a BooleanQuery and delegate rewrite, createWeight 
> etc to it.
> That will remove the need for the static utility methods .. or we can keep 
> static term() for convenience.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to