lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Question: force a field must be matched?
Date Fri, 16 Sep 2005 16:42:57 GMT

On Sep 15, 2005, at 12:55 PM, James Huang wrote:
> Thanks Jason.
>
> I wonder if that's the same as
>
>   queryString + " publisher:Manning"
>
> and pass on to the query parser?

I will emphasize the other comments made on this regarding the  
Analyzer.  I recommend against programatically adding to the string  
passed to QueryParser because of these types of issues.  You can  
aggregate a parsed expression Query into a BooleanQuery with other  
programmatically created Query objects (such as TermQuery in this case).

     Erik



>
> -James
>
> --- Jason Haruska <jason@haruska.com> wrote:
>
>
>> On 9/15/05, James Huang <metaprgmr@yahoo.com> wrote:
>>
>>>
>>> Suppose I have a book index with
>>>
>> field="publisher", field="title", etc.
>>
>>> I want to search for books only from "Manning", do
>>>
>> I have to do anything
>>
>>> special? how?
>>>
>>>
>>
>> add new BooleanClause(new TermQuery(new
>> Term("publisher","Manning")), true,
>> false) to your BooleanQuery
>>
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> 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