You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jason Eacott <je...@hardlight.com.au> on 2005/04/06 04:50:35 UTC

lucene 1.4 + needs spaces problem

Hi,
	 I recently upgraded from lucene 1.3 final to 1.4 and discovered some things 
which no longer seem to work right.

I am using 
Analyzer analyzer = new StandardAnalyzer();
QueryParser parser = new QueryParser( "terms", analyzer); 
parser.setOperator(QueryParser.DEFAULT_OPERATOR_AND); 
query = parser.parse(TextParameters);

I then proceed to flesh out the query with a bunch of BooleanQuery's

all this works great with the older lucene but I get lots of error s in the trace because I am 
also using the compoundindex (need to on a windoze box to prevent too many file handles 
issues)

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)

I know I have and set by default but this should still work I think.

thanks in Advance

Jason.

btw - the mailinglist search is broken, I get
 VelocityServlet: Error processing the template 
 null: Got error 127 from table handlerorg.apache.velocity.exception.VelocityException: 
null: Got error 127 from table handler 
      at org.tigris.eyebrowse.servlets.EyebrowseServlet.handleRequest(Unknown Source) 
      at org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:396) 
      at org.tigris.eyebrowse.servlets.EyebrowseServlet.doRequest(Unknown Source) 

for this URL
http://nagoya.apache.org/eyebrowse/BrowseList?listName=lucene-
user@jakarta.apache.org&from=&to=&count=12556&by=date&first=41&windowSize=20&s
electedPage=3


Thanks
Jason.



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


Re: lucene 1.4 + needs spaces problem

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
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