lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: threadsafe QueryParser?
Date Mon, 09 Oct 2006 17:54:36 GMT
On 10/9/06, Stanislav Jordanov <stenly@sirma.bg> 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
http://incubator.apache.org/solr Solr, the open-source Lucene search server

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


Mime
View raw message