lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Re: Is creating an analyzer expensive?
Date Thu, 12 Jul 2012 22:22:13 GMT
You can safely reuse a single analyzer across threads. The Analyzer
class maintains ThreadLocal storage for TokenStreams internally so you
can just create the analyzer once and use it throughout your


On Thu, Jul 12, 2012 at 10:13 PM, Dave Seltzer <> wrote:
> I have one more question to pose to the group today:
> I have several thousand searches being performed against MemoryIndexes on
> a regular basis.
> I'd like the ability for each search to choose it's own Analyzer, such
> that some queries could use a regex pattern, other queries could use the
> Standard Analyzer.
> Does anyone know how expensive it is to create an Analyzer? Am I better
> off creating analyzers as needed, or should I store them once and re-use
> them?
> Thanks very much!
> -Dave
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message