Hoss Man updated LUCENE-395:
Paul: i thought i had accounted for both situations, but you're right -- it's not enough to make sure that all of the existing usages of DisjunctionSumScorer now use the min cut-off, because when there are required scorers, the existing uses of DisjunctionSumScorer are allways treated as optional. the internal logic in makeCountingSumScorer basically needs to be "turned inside out" so that if the min value is set, a DisjunctionSumScorer is constructed, and treated as a required scorer.
I started trying to do this but i haven't really made any progress, and now i have to go get on a plane, so unless someone else takes a stab at it, I'll try to post an updated patch on monday.
in the mean time, here is a revised version of the test class that accounts for more possible code paths in the existing logic (particularly, the difference in behavior when there is one required vs more then one required, and/or one prohibited vs more then one prohibited.
> CoordConstrainedBooleanQuery + QueryParser support
> Key: LUCENE-395
> URL: http://issues.apache.org/jira/browse/LUCENE-395 > Project: Lucene - Java
> Type: Improvement
> Components: Search
> Versions: unspecified
> Environment: Operating System: other
> Platform: Other
> Reporter: Mark Harwood
> Assignee: Lucene Developers
> Priority: Minor
> Attachments: CoordConstrainedBooleanQuery.java, CoordConstrainedBooleanQuery.java, CustomQueryParserExample.java, CustomQueryParserExample.java, LUCENE-395.patch, TestBooleanMinShouldMatch.java, TestBooleanMinShouldMatch.java
> Attached 2 new classes:
> 1) CoordConstrainedBooleanQuery
> A boolean query that only matches if a specified number of the contained clauses
> match. An example use might be a query that returns a list of books where ANY 2
> people from a list of people were co-authors, eg:
> "Lucene In Action" would match ("Erik Hatcher" "Otis Gospodnetić" "Mark Harwood"
> "Doug Cutting") with a minRequiredOverlap of 2 because Otis and Erik wrote that.
> The book "Java Development with Ant" would not match because only 1 element in
> the list (Erik) was selected.
> 2) CustomQueryParserExample
> A customised QueryParser that allows definition of
> CoordConstrainedBooleanQueries. The solution (mis)uses fieldnames to pass
> parameters to the custom query.