lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gwyn Carwardine" <g...@carwardine.net>
Subject RE: Handling of colons in QueryParserTokenManager
Date Mon, 23 Jan 2006 11:24:52 GMT
Thanks for your reply Erik (good book by the way)

It definitely was producing the error. I was very careful to test before I
posted. But now, as you say, it doesn't do it.

However, I wonder if I was entering ["Fred" TO "joe"] (note the capital F)
because that IS still coming back with HTTP 500 error every time.

http://www.lucenebook.com/search?query=%5B%22Fred%22+TO+%22joe%22%5D

I thought I did mention colons!

Format of a query part in Lucene is field:value

However if the value itself contains a colon then the
QueryParserTokenManager seems to truncate the value at that point. I would
like to change this behaviour, in fact I think it's behaving illogically..
the Token Manager's job is to parse into field & value, it shouldn't make
any decisions about the value; that value should get passed intact (complete
with colons and any other special characters) through to the Analyzer who's
job it is to.. well.. analyse!

Gwyn


-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
Sent: 23 January 2006 01:38
To: java-dev@lucene.apache.org
Subject: Re: Handling of colons in QueryParserTokenManager


On Jan 21, 2006, at 2:16 PM, Gwyn Carwardine wrote:
> Of course I think someone needs to go into the internals anyway...  
> on 1.4.3
> I get an index out of array bounds error (not a nice parse  
> exception) when
> it tries to parse the following (which it should be able to do):
>
> ["fred" TO "joe"]
>
> Maybe this is fixed in 1.9 but I tried it on the www.lucenebook.com  
> search
> assuming that was using a recent version and that generates a  
> server error!

It does not generate a server error on lucenebook.com:

	
<http://www.lucenebook.com/search?query=%5B%22fred%22+TO+%22joe%22%5D>

Maybe you happened to hit the server at some point when there was an  
issue with the server itself (?), but I just tried it and get plenty  
of results.

> It's a real shame that the QueryParserTokenManager had no comments  
> put in to
> explain what on earth it's doing!

Look at QueryParser.jj - that is where the rest is generated from,  
using JavaCC.

Your subject mentions colons, but your example doesn't.  Besides the  
range query example, is there an issue with colons that you want to  
ask about?

	Erik


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



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


Mime
View raw message