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 resulting queries may > have all kinds of weird problems, for example missing terms, duplicate terms, > etc. > > I don't like the idea of creating a new queryparser for each query, so I am > looking for alternatives. Any ideas?
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. -- Miles Barr <[EMAIL PROTECTED]> Runtime Collective Ltd. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]