Hey,

I do not think mergeBooleanQueries is necessary. It
sounds like what you want to do is this:

Query userEntered = QueryParser.parse("foo bar");
Query otherQuery = new TermQuery(new
Term("myfield","abc defg"));

BooleanQuery completeQuery = new BooleanQuery();
completeQuery.add(userEntered,true,false);
completeQuery.add(otherQuery,true,false);

Then just use completeQuery in your search. Hope I
understood your issue correctly. Also as a note, the
syntax above will work in Lucene 1.4.3, but it looks
like BooleanQuery.add() has changed in 2.0.0.

JAMES

--- zzzzz shalev <[EMAIL PROTECTED]> wrote:

> i apologize in advance for the question.
>    
>   i am running lucene 1.4.3 (prefer not to use the
> keywordanalyzer)
>    
>   i need to mix a user entered query along with a
> search on keyword indexed fields
>    
>   how would i search for an exact phrase using a
> term query on a keyword field while searching for
> user entered text on separate 'text' fields
>   ideas?
>    
>   i tried using the mergeBooleanQueries using the
> query recieved from the queryparser and a new
> boolean query containing a termquery, but i must be
> missing something basic in the lucene search syntax.
>    
>   The termquery contains a phrase, and for some
> reason passing the following boolean query:
>    
>   .add(new termquery(new term(myfield,"abc defg")) ,
> true , false) along with the query from the
> queryparser to the merge function is not returning
> what i would expect
>    
>   thanks in advance,
>    
>    
>    
>    
>    
>    
> 
>               
> ---------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls
> to the US (and 30+ countries) for 2�/min or less.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to