lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Sellman" <ssell...@valueclick.com>
Subject RE: MultiFieldQueryParser doesn't properly filter out documents when the query string specifies to exclude certain terms
Date Wed, 20 Dec 2006 16:18:54 GMT
>Please try using the MultiFieldQueryParser's constructor, not the static >method. I
think that might fix your problem.

Yes, after I created a new MultiFieldQueryParser and calling the parse( String query) method
my search executed as expected.  

Thanks for your help!
Scott

>> BooleanClause.Occur[]{BooleanClause.Occur.SHOULD,
>> BooleanClause.Occur.SHOULD}

>Why do you explicitly specify these operators?

I am using the parse(String query, String[] fields, BooleanClause.Occur[] flags, Analyzer
analyzer) method as opposed to parse(String[] queries, String[] fields, Analyzer analyzer).
 They seem to have the same result. 

>> q.add(keywordQuery, BooleanClause.Occur.MUST); 

>You seem to wrap a query in another BooleanQuery. As long as keywordQuery 
>is the only query that doesn't seem to make sense. 

I am adding additional Query objects later on in my code.
-----Original Message-----
From: Daniel Naber [mailto:lucenelist2005@danielnaber.de] 
Sent: Tuesday, December 19, 2006 4:06 PM
To: java-user@lucene.apache.org
Subject: Re: MultiFieldQueryParser doesn't properly filter out documents when the query string
specifies to exclude certain terms

On Tuesday 19 December 2006 23:05, Scott Sellman wrote:

>                         new
> BooleanClause.Occur[]{BooleanClause.Occur.SHOULD,
> BooleanClause.Occur.SHOULD}

Why do you explicitly specify these operators?

> q.add(keywordQuery, BooleanClause.Occur.MUST); 

You seem to wrap a query in another BooleanQuery. As long as keywordQuery 
is the only query that doesn't seem to make sense. Please try using the 
MultiFieldQueryParser's constructor, not the static method. I think that 
might fix your problem.

Regards
 Daniel

-- 
http://www.danielnaber.de

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

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


Mime
View raw message