Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B216AEB97 for ; Mon, 25 Feb 2013 10:18:53 +0000 (UTC) Received: (qmail 32397 invoked by uid 500); 25 Feb 2013 10:18:50 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 31756 invoked by uid 500); 25 Feb 2013 10:18:50 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 31378 invoked by uid 99); 25 Feb 2013 10:18:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 10:18:49 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ian.lea@gmail.com designates 209.85.223.172 as permitted sender) Received: from [209.85.223.172] (HELO mail-ie0-f172.google.com) (209.85.223.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 10:18:39 +0000 Received: by mail-ie0-f172.google.com with SMTP id c10so2854386ieb.17 for ; Mon, 25 Feb 2013 02:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=IDafyjsHx/dqtlbNmLHfIupSHkOV47JdHQPV03U2WrU=; b=vC4CLgbcReDQSQlac0v9dRO+EJ4dg3CXgo1EGJkQDDgvRGmNWySYyFA+wotseVxcOg 0AV5YBkbVUSZ52aPzIagkcNwtLMm45QlyzLP3QAbxnyW9GovpH9LELsq5TS37v9uxeQx 75g4T/31nHk0VyJV/Q7YIPre8GIRicJggrtTXcMbwb8x1YldLP7titVrlR88Vfu+k/k3 n1L4SVbksHdZ1MybbZzAe9kKLDBaMBtTss9d0bkK8OmGWc98dxwdvUF4iz93FDxRtI0Q mTSa59WVxOhfZ7ZKB9d46EYUY3d0V+6qXrV79i52MZSnKyAfgzQtOh7ovhJHfPD7JWih q63A== X-Received: by 10.50.217.167 with SMTP id oz7mr3205262igc.26.1361787499128; Mon, 25 Feb 2013 02:18:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.203.42 with HTTP; Mon, 25 Feb 2013 02:17:59 -0800 (PST) In-Reply-To: References: From: Ian Lea Date: Mon, 25 Feb 2013 10:17:59 +0000 Message-ID: Subject: Re: Lucene filter questions To: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org I'm sure that Filters are thread safe. Lucene doesn't have a global caching mechanism as such. But see FieldCache - you might get better performance from FieldCacheTermsFilter than from TermsFilter. See also CachingWrapperFilter and QueryWrapperFilter. -- Ian. On Mon, Feb 25, 2013 at 1:16 AM, Wei Wang wrote: > Hi, > > I am a Lucene user and I have a few questions about Lucene filters. > I appreciate it if someone can shed light on this. > > 1. Is Lucene filters such as TermsFilter thread-safe in general? > The semantics of a Filter is fixed, unless a filter maintains some > private state information, theoretically it could be thread-safe and > the same Filter can be used by multiple queries at the same time. > > 2. Does Lucene has a global Caching mechanism for filters or even > queries? Or a user has to manage them by himself? > It probably can better use resource if the cached filters/queries > are managed at a central place. I noticed FilterManager was removed > from Lucene 4. Is there another class replacing FilterManager? > > Thanks! > Wei > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org