Hi! I've been having problems with lucene's QueryParser, apparently it is not
thread-safe.
That means I can't parse queries in threads where the queryparser object is
created once and reused for each query. If I do, the resulting queries may have
all kinds of weird problems, for example missin
On Tue, 2005-08-23 at 13:47 -0300, [EMAIL PROTECTED] wrote:
> Hi! I've been having problems with lucene's QueryParser, apparently it is not
> thread-safe.
>
> That means I can't parse queries in threads where the queryparser object is
> created once and reused for each query. If I do, the resul
On Tue, 2005-08-23 at 12:01, Miles Barr wrote:
> Using a non-threadsafe object in a threaded environment is fairly
> standard in Java, just wrap it in a synchronized block.
>
> If you don't want all threads waiting on one query parser, create a pool
> of them.
Based on doing the simplest possib
On Tuesday 23 August 2005 19:01, Miles Barr wrote:
> On Tue, 2005-08-23 at 13:47 -0300, [EMAIL PROTECTED] wrote:
> > Hi! I've been having problems with lucene's QueryParser, apparently it is
not thread-safe.
> >
> > That means I can't parse queries in threads where the queryparser object
is cre
Right. My philosophy is that, make it work, then, make it better.
Don't waste time on something that you are not sure if it would cause
performance problem.
Jian
On 8/23/05, Paul Elschot <[EMAIL PROTECTED]> wrote:
> On Tuesday 23 August 2005 19:01, Miles Barr wrote:
> > On Tue, 2005-08-23 at 13
EMAIL PROTECTED]
Sent: dinsdag 23 augustus 2005 21:38
To: java-user@lucene.apache.org
Subject: Re: QueryParser not thread-safe
Right. My philosophy is that, make it work, then, make it better.
Don't waste time on something that you are not sure if it would cause
performance problem.
Ji
alls
> threadLocalQueryParser.get().
>
> See the javadoc for java.lang.ThreadLocal
>
> Luc
>
>
> -Original Message-
> From: jian chen [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 23 augustus 2005 21:38
> To: java-user@lucene.apache.org
> Subject: Re: Query
0
> Para: java-user@lucene.apache.org
> Asunto: Re: QueryParser not thread-safe
>
>
> I would just create a new QueryParser for each query. Allocating
> short-lived objects is just about free in java, and the time spent
> performing the actual search will by far dominate any time
On Wed, 2005-08-24 at 12:10 -0300, [EMAIL PROTECTED] wrote:
> Now, while I agree that simple is better, I think QueryParser should
> be made thread-safe through the use of a wrapper class (along the
> line of what Luc suggested) or by using something other than javacc,
> so this is no longer an