lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Re: threadsafe QueryParser?
Date Mon, 09 Oct 2006 17:54:36 GMT
On 10/9/06, Stanislav Jordanov <> wrote:
> Method
> static public Query parse(String query, String field, Analyzer analyzer)
> in class QueryParser is deprecated in 1.9.1 and the suggestion is: /"Use
> an instance of QueryParser and the {@link #parse(String)} method instead."/
> My question is: in the context of multi threaded app, is it safe that
> distinct threads utilize the same instance of QueryParser for parsing
> their queries?
> ps. After writing this letter, I incidentally ran into the answer in the
> end of the class comment of QueryParser:
> / * <p>Note that QueryParser is <em>not</em> thread-safe.</p>/
> So, is this it?

Yes.  A single QueryParser object should not be used from multiple threads.
It's unclear why one would want to do so anyway.

-Yonik Solr, the open-source Lucene search server

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message