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 Les Hughes <le...@rubus.com> on 2002/02/20 12:14:05 UTC

Queryparser croaking on "[" and "]"

Hi,

I'm currently building a small app that allows searching of Java sourcecode.
The problem I'm getting is when parsing a query string that contains an
array specifier (ie. String[] or int[][]) the query parser seem to croak
with a

Lexical error at line XX, column XX. Encountered:   after : "[]"


So what am I doing wrong / what should I write to fix this?


Les


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


SerializableRAMDirectory

Posted by Karl Oie <ka...@gan.no>.
Hi, I just added the Serializable implementation keyword to the RAMDirectory
implementation. This way I can just write the whole RAMDirectory to a
database blob for storage. After reading the RAMDir from the blob again I
can successfully perform searches on the new instance.

This started out because I got too many "too many open files" exceptions
using the FSDirectory. Then I tried to create a BLOBDirectory
implementation, but found that the lucene In/OutputStream classes to require
seek(). So when lucene wants to open a file in a BLOBDirectory I had to
fetch the whole BLOB for the file into memory so I could provide all the
functions required by the lucene Directory interface.

Since the RAMDirectory already works great in-memory, serializing it to the
BLOB after read/write sounded like a just as good idea.

If there is nothing I have overseen here I would suggest to add the
Serializable implementation keyword to the RAMDirectory implementation
because that was all it required.


mvh karl oie

Re: Queryparser croaking on "[" and "]"

Posted by Brian Goetz <br...@quiotix.com>.
This is because the query parser uses [] to denote ranges of numbers.
(I always thought this was a bad choice of syntax for exactly this
reason.)


On Wed, Feb 20, 2002 at 11:14:05AM -0000, Les Hughes wrote:
> Hi,
> 
> I'm currently building a small app that allows searching of Java sourcecode.
> The problem I'm getting is when parsing a query string that contains an
> array specifier (ie. String[] or int[][]) the query parser seem to croak
> with a
> 
> Lexical error at line XX, column XX. Encountered:   after : "[]"
> 
> 
> So what am I doing wrong / what should I write to fix this?
> 
> 
> Les
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>