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 1981699F4 for ; Sun, 19 Feb 2012 14:53:43 +0000 (UTC) Received: (qmail 98927 invoked by uid 500); 19 Feb 2012 14:53:41 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 98883 invoked by uid 500); 19 Feb 2012 14:53:41 -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 98873 invoked by uid 99); 19 Feb 2012 14:53:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Feb 2012 14:53:41 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FSL_RCVD_USER,SPF_PASS,URIBL_DBL_REDIR X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of uwe@thetaphi.de designates 188.138.97.18 as permitted sender) Received: from [188.138.97.18] (HELO mail.sd-datasolutions.de) (188.138.97.18) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Feb 2012 14:53:34 +0000 Received: from VEGA (port-92-196-20-167.dynamic.qsc.de [92.196.20.167]) by mail.sd-datasolutions.de (Postfix) with ESMTPSA id 1583014AA013 for ; Sun, 19 Feb 2012 14:53:14 +0000 (UTC) From: "Uwe Schindler" To: References: In-Reply-To: Subject: RE: Counting all the hits with parallel searching Date: Sun, 19 Feb 2012 15:53:54 +0100 Message-ID: <002b01ccef16$4cd41c30$e67c5490$@thetaphi.de> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFBy97GOkOTyVVLOohiblWdUIeqL5dak70Q Content-Language: de X-Virus-Checked: Checked by ClamAV on apache.org By passing Integer.MAX_VALUE you are requesting Lucene to allocate a = priority queue for collecting results with that size, this OOMs. With = Lucene if you are using TopDocs, the idea is to only get a limited = amount of Top-Ranking documents to display search results. The user is = not interested in the 2 million's result page, so pass a small number of = top hits. To simply count all hits like you seem to do, there is a separate = collector available: http://goo.gl/XsPVR ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: Benson Margulies [mailto:bimargulies@gmail.com] > Sent: Sunday, February 19, 2012 3:22 PM > To: java-user@lucene.apache.org > Subject: Counting all the hits with parallel searching >=20 > If I have a lot of segments, and an executor service in my searcher, = the > following runs out of memory instantly, building giant heaps. Is there = another > way to express this? Should I file a JIRA that the parallel code = should have some > graceful behavior? >=20 > int longestMentionFreq =3D searcher.search(longestMentionQuery, = filter, > Integer.MAX_VALUE).totalHits + 1; >=20 > --------------------------------------------------------------------- > 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