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 BFA9B7EF2 for ; Mon, 1 Aug 2011 12:54:15 +0000 (UTC) Received: (qmail 44748 invoked by uid 500); 1 Aug 2011 12:54:13 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 44587 invoked by uid 500); 1 Aug 2011 12:54:12 -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 44579 invoked by uid 99); 1 Aug 2011 12:54:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2011 12:54:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ian.lea@gmail.com designates 74.125.82.48 as permitted sender) Received: from [74.125.82.48] (HELO mail-ww0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2011 12:54:06 +0000 Received: by wwi14 with SMTP id 14so3747328wwi.5 for ; Mon, 01 Aug 2011 05:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=PrkQuC8FSnj1lD44jC7TOfkdpnHm9qTciccG97pKs+4=; b=WQdzUt+SnFyjoSb9jfKQokBi562/iMO8rr2+r4PO39cZaPI5L5joBcIdrbd4vUL3gN mxdWofG1P1P43DCC/SPkqd4/JeLSYFxHLXQ7R6vBeHS4RT9eSO2Z8Ew/l3Ubbh9zLMLU dAsSmKDQcaPO+C/RYddjciTLec3pzJf+eUuDA= Received: by 10.227.202.193 with SMTP id ff1mr6166851wbb.44.1312203225102; Mon, 01 Aug 2011 05:53:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.157.201 with HTTP; Mon, 1 Aug 2011 05:53:25 -0700 (PDT) In-Reply-To: <1311948537895-3209688.post@n3.nabble.com> References: <1311584854737-3196928.post@n3.nabble.com> <006201cc4ab1$825ecee0$871c6ca0$@thetaphi.de> <1311603387783-3197593.post@n3.nabble.com> <008b01cc4ad7$77d19630$6774c290$@thetaphi.de> <1311948537895-3209688.post@n3.nabble.com> From: Ian Lea Date: Mon, 1 Aug 2011 13:53:25 +0100 Message-ID: Subject: Re: Reusing a CachingWrapperFilter To: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 My guess is that it would depend on the number of docs in the index, how many match, how complex your query is, probably other things. If q is complex the MatchAllDocs variant might be well be quicker but if q is simple I wouldn't like to guess. I'm not sure there is any point in passing the filter to the ConstantScore variation. An alternative might be to use the filter directly via it's DocIdSet. Whatever you do, searching is generally very quick. Reading doc values, formatting, whatever, is often what takes the time. -- Ian. On Fri, Jul 29, 2011 at 3:08 PM, Konstantyn Smirnov wrote: > If I define a query and filter like this: > > Query q = new BooleanQuery() > // populating q > > Filter filter = new CachingWrapperFilter( new QueryWrapperFilter( q ) ) > > given that I don't need score and I do need a cached filter to reuse it > immediately for other calculations, which way of searching would be the most > performing: > > searcher.search( new MatchAllDocsQuery(), filter, max ) > > or > > searcher.search( new ConstantScoreQuery( q ), filter, max ) > > or > > something completely different? > > TIA > > -- --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org