lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-395) CoordConstrainedBooleanQuery + QueryParser support
Date Fri, 04 Nov 2005 06:17:27 GMT
    [ http://issues.apache.org/jira/browse/LUCENE-395?page=comments#action_12356750 ] 

Hoss Man commented on LUCENE-395:
---------------------------------

: One thing I found is that when minNrShouldMatch>0 with 
: nested boolean queries, the scores may not match for those
: documents that match the same query with 
: minNrShouldMatch=0.  Is this expected?

...hmm.  assuming you mean that you only set minNrShouldMatch in the root query, and the nested
queries are vanilla BooleanQueries -- then no, that doesn't sound expected.

If the subqueries had minNrShouldMatch set (regardless of wether or not the root query did),
then yes i can imagine some cases where the scores would be different (even if the result
set is the same).  Consider the following nesting scenerio...

   ( (A B X) (C D Y) (E W Z) )

If document #42 matches A, B, C, D, and E, but does NOT match X, Y or Z, then it will easily
match this query.  Even if all of the subqueries are modified so that minNrShouldMatch=2,
the result set will be the same -- but the score for document#42 *SHOULD* be different, because
it no longer matches enough individual clauses in the third sub query to get a score contribution
from it (ie: the match on E no longer improves the score)

But, if all you do is set minNrShouldMatch > 0 on the outermost query ... I can't think
of any reason why the score would chance if the document still matches (other then a bug)

Can you post your test?




> 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: BooleanScorer2.java, CoordConstrainedBooleanQuery.java, CoordConstrainedBooleanQuery.java,
CustomQueryParserExample.java, CustomQueryParserExample.java, LUCENE-395.patch, LUCENE-395.patch,
LUCENE-395.patch, TestBooleanMinShouldMatch.java, TestBooleanMinShouldMatch.java, TestBooleanMinShouldMatch.java,
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&#263;" "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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


Mime
View raw message