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: Memo: Re: RE: RE: Query parser and minus signs
Date Wed, 26 May 2004 16:24:30 GMT

On May 26, 2004, at 10:48 AM, alex.bourne@hsbcam.com wrote:
> Query: hsbc -language:zh-HK
> Parsed query: (contents:hsbc -language:zh -contents:hk) (keywords:hsbc 
> -language:zh -keywords:hk) (title:hsbc -language:zh -title:hk) 
> (language:hsbc
> -language:zh -language:HK)
> Hits: 169
> Not quite what I was expecting from the parsed query - the zh and HK 
> are now separated.

I think I can safely say that you are not running the latest version of 
Lucene.  This has been corrected in the 1.4 versions.

I've tested this with "Wal-Mart" (without the quote) and QueryParser, 
and it works as expected.


> Query: hsbc -language:zh\-HK
> Parsed query: (contents:hsbc -language:zh\-HK) (keywords:hsbc 
> -language:zh\-HK) (title:hsbc -language:zh\-HK) (language:hsbc 
> -language:zh\-HK)
> Hits: 206
> And I'm guessing here, but I don't think the slash is escaping, does 
> it just become part of the query??

Now that is odd.

QueryParser is an awkward beast at times, and combining it with 
MultiFieldQueryParser (which I'd recommend against, as you can see with 
the odd queries it built for you) gets even more confusing.

Hopefully the latest Lucene 1.4 RC release will fix up your situation.

	Erik


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


Mime
View raw message