[ https://issues.apache.org/jira/browse/LUCENE-4580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508200#comment-13508200 ]
Shai Erera commented on LUCENE-4580: ------------------------------------ Not that I'm against adding dependencies between modules, but just to give some data points: * The queries module is not a MUST for every search application (let alone faceted search). The basic query components are in core already (Filter, Query, TermQuery, BooleanQuery etc.). I found the queries module useful (so far) for the {{BooleanFilter}} and {{TermsFilter}} classes. * A question was recently asked on the user list how to make {{DrillDown}} create OR queries instead of AND. The scenario -- you have a facet dimension for which you would like to allow people to select multiple values, and OR them (while still AND-ing with other dimensions). Since {{DrillDown}} doesn't have that option, I offered the user to use DrillDown.term() and construct his own BooleanQuery. ** My point is that {{DrillDown}} is a helper class that doesn't cover all cases already. Even if we make it return a Filter, that user will still need to construct BooleanFilter doing several API calls. ** So I'm ok if it only exposes terms(), but I'm also ok if we add the queries dependency and just make the cut over to Filter instead of Query. ** Or better, move TermsFilter and BooleanFilter to core -- why are they treated differently than TermQuery and BooleanQuery? Especially now that Filter is applied more efficiently, I suspect more people will want to use it? * I am all for usability, but {{TermsFilter}} is not like {{BooleanQuery}} in the sense that it's very easy to create it (just one line of code). I'm not sure that if BooleanQuery had a ctor which accepts {{List<Term>}}, we wouldn't have used it in {{DrillDown}}, or if we even create the DrillDown.query API. So the 'same code over and over' is not comparable between the two cases, I think. > Facet DrillDown should return a Filter not Query > ------------------------------------------------ > > Key: LUCENE-4580 > URL: https://issues.apache.org/jira/browse/LUCENE-4580 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/facet > Reporter: Shai Erera > Priority: Minor > > DrillDown is a helper class which the user can use to convert a facet value > that a user selected into a Query for performing drill-down or narrowing the > results. The API has several static methods that create e.g. a Term or Query. > Rather than creating a Query, it would make more sense to create a Filter I > think. In most cases, the clicked facets should not affect the scoring of > documents. Anyway, even if it turns out that it must return a Query (which I > doubt), we should at least modify the impl to return a ConstantScoreQuery. -- 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org