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: lucene 1.4 + needs spaces problem
Date Wed, 06 Apr 2005 09:06:07 GMT

On Apr 5, 2005, at 10:50 PM, Jason Eacott wrote:

> Hi,
> 	 I recently upgraded from lucene 1.3 final to 1.4 and discovered some  
> things
> which no longer seem to work right.
>
> anyway -
> if I run a query something like
> properties@conf: 
> false+properties@year:"2004"+properties@month:"February"+properties
> @committee:"Council"
>
> it no longer works unless I ensure there are spaces around each +
>
> eg this works
>
> properties@conf:false + properties@year:"2004" +  
> properties@month:"February" +
> properties@committee:"Council"
>
> can anyone tell me if this has been fixed somewhere or whether this  
> was by design? (I
> cannot imagine that it is)

This was by design.  The issue is where to draw the boundaries for  
terms.  In 1.3, "Wal-mart" was treated as "wal NOT mart" so we added  
"-" and "+" to be considered term characters.

This change is noted in the CHANGES.txt file that is packaged with  
Lucene distributions, and says this:

13. Changed QueryParser.jj to allow '-' and '+' within tokens:
     http://issues.apache.org/bugzilla/show_bug.cgi?id=27491
     (Morus Walter via Otis)

In other words, you'll need to add whitespace, or if this is a drastic  
issue for your users you can clone QueryParser and change the grammar  
slightly (remove "+" and "-" from #_TERM_CHAR and use your custom query  
parser.

	Erik


---------------------------------------------------------------------
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