You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Karl Wright (JIRA)" <ji...@apache.org> on 2011/09/23 14:48:27 UTC
[jira] [Issue Comment Edited] (LUCENE-3450) BooleanQuery seems
broken on trunk
[ https://issues.apache.org/jira/browse/LUCENE-3450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13113376#comment-13113376 ]
Karl Wright edited comment on LUCENE-3450 at 9/23/11 12:48 PM:
---------------------------------------------------------------
bq. From your example patch, i see only MUST_NOT clauses. This cannot work.
I agree that the first clause must have a MatchAllQuery added, but that's not the failure I'm looking at. The case in question involves the SECOND clause:
{code}
// Extend the query appropriately for each user access token.
- bf.add(new FilterClause(calculateCompleteSubfilter(fieldAllowShare,fieldDenyShare,userAccessTokens),BooleanClause.Occur.MUST));
- bf.add(new FilterClause(calculateCompleteSubfilter(fieldAllowDocument,fieldDenyDocument,userAccessTokens),BooleanClause.Occur.MUST));
+ bq.add(calculateCompleteSubquery(fieldAllowShare,fieldDenyShare,userAccessTokens),BooleanClause.Occur.MUST);
+ bq.add(calculateCompleteSubquery(fieldAllowDocument,fieldDenyDocument,userAccessTokens),BooleanClause.Occur.MUST);
{code}
The first clause is used only when a user has no tokens, which has a test but is not the one I've singled out.
The actual query being generated in this case is:
{code}
[junit] +((-allow_token_share:* -deny_token_share:*) allow_token_share:token1 -deny_token_share:token1) +((-allow_token_document:* -deny_token_document:*) allow_token_document:token1 -deny_token_document:token1)
{code}
Does this look like it is constructed incorrectly to you? Or are you saying that the subclause "(-allow_token_share:* -deny_token_share:*)" has the same problem? I'll experiment with this and see what I get...
was (Author: kwright@metacarta.com):
bq. From your example patch, i see only MUST_NOT clauses. This cannot work.
I agree that the first clause must have a MatchAllQuery added, but that's not the failure I'm looking at. The case in question involves the SECOND clause:
{code}
// Extend the query appropriately for each user access token.
- bf.add(new FilterClause(calculateCompleteSubfilter(fieldAllowShare,fieldDenyShare,userAccessTokens),BooleanClause.Occur.MUST));
- bf.add(new FilterClause(calculateCompleteSubfilter(fieldAllowDocument,fieldDenyDocument,userAccessTokens),BooleanClause.Occur.MUST));
+ bq.add(calculateCompleteSubquery(fieldAllowShare,fieldDenyShare,userAccessTokens),BooleanClause.Occur.MUST);
+ bq.add(calculateCompleteSubquery(fieldAllowDocument,fieldDenyDocument,userAccessTokens),BooleanClause.Occur.MUST);
{code}
The first clause is used only when a user has no tokens, which has a test but is not the one I've singled out.
The actual query being generated in this case is:
{code}
[junit] +((-allow_token_share:* -deny_token_share:*) allow_token_share:token1 -deny_token_share:token1) +((-allow_token_document:* -deny_token_document:*) allow_token_document:token1 -deny_token_document:token1)
{code}
Does this look like it is constructed incorrectly to you?
> BooleanQuery seems broken on trunk
> ----------------------------------
>
> Key: LUCENE-3450
> URL: https://issues.apache.org/jira/browse/LUCENE-3450
> Project: Lucene - Java
> Issue Type: Bug
> Reporter: Karl Wright
> Attachments: filter.diff, query.diff
>
>
> Converting a Solr SearchComponent from using filters to using equivalent queries causes its test cases to fail. The reasons are unclear, and I've tried several things to isolate the problem, but with no luck so far.
> The failure manifests itself by the constructed query returning no documents whatsoever, at least within the Solr context it's being used in. The equivalent filter version of the component works properly (as you can see by the passed test).
> To run the test:
> cd solr/contrib/mcf
> ant test
> I will attach both filter and query versions of the code, as patches.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org