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 22C476C5F for ; Sun, 22 May 2011 17:19:36 +0000 (UTC) Received: (qmail 23763 invoked by uid 500); 22 May 2011 17:19:33 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 23719 invoked by uid 500); 22 May 2011 17:19:33 -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 23711 invoked by uid 99); 22 May 2011 17:19:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 May 2011 17:19:33 +0000 X-ASF-Spam-Status: No, hits=2.1 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLYTO,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simon.willnauer@googlemail.com designates 209.85.213.176 as permitted sender) Received: from [209.85.213.176] (HELO mail-yx0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 May 2011 17:19:28 +0000 Received: by yxd5 with SMTP id 5so2724166yxd.35 for ; Sun, 22 May 2011 10:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=mzUBtfAmYVym5RYlxms2jUlJA7GYTUG5+xBaUz1xEIA=; b=kbH+bUHmeqFr/jQz+b9NY/wKgKLFJ2V/gPTjGt9DHvftBailPkOa+lJSybgxtj3tQx ccXCoMtwN+jQUYXMX09M3MeXSCIU9lqcGzVpKOaqh1LIUEsPq7tGs60mrgj5yYgPV/hX /kCWscE68f2AXfDwi79LIwk0ROeTm5hmJ/5Ro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=CjXroy8XaoZvg4UKWylPSfUDA2cpPE7lwEBRJvruJ1FNyjIbNv5KZgFp4iBKSV/MNb aP0C8VuhFrnnXSb4uMnMNQGfYBk/EGGjB2WBVcEpUQ0Kx3KEb6VKmw86qOjLGran+WmF 6AjMvZlNRXwcOsuagiP42OnHF67AlWpH6eJTs= MIME-Version: 1.0 Received: by 10.236.170.138 with SMTP id p10mr1877393yhl.175.1306084747952; Sun, 22 May 2011 10:19:07 -0700 (PDT) Received: by 10.236.202.229 with HTTP; Sun, 22 May 2011 10:19:07 -0700 (PDT) Reply-To: simon.willnauer@gmail.com In-Reply-To: References: Date: Sun, 22 May 2011 19:19:07 +0200 Message-ID: Subject: Re: stop the search From: Simon Willnauer To: "Devon H. O'Dell" Cc: java-user@lucene.apache.org Content-Type: text/plain; charset=UTF-8 On Sun, May 22, 2011 at 4:48 PM, Devon H. O'Dell wrote: > I have my own collector, but implemented this functionality by running > the search in a thread pool and terminating the FutureTask running the > job if it took longer than some configurable amount of time. That > seemed to do the trick for me. (In my case, the IndexReader is > explicitly opened readonly, so I'm not too worried about it). This can be super dangerous if you use Future. cancel() ie. Thread.interrupt(). If the interrupt is called while you are reading from a NIO FileDescriptor the channel will be closed and Lucene can not recover from that state if the file has already been merged away. Your Reader will get ChannelAlreadyClosed exceptions for any subsequent access. You should prevent this. see FSDirectory Javadoc http://lucene.apache.org/java/3_1_0/api/core/org/apache/lucene/store/FSDirectory.html simon > > --dho > > 2011/5/22 Simon Willnauer : >> you can impl. you own collector and notify the collector to stop if you need to. >> simon >> >> On Sun, May 22, 2011 at 12:06 PM, liat oren wrote: >>> Hi Everyone, >>> >>> Is there a way to stop a multi search in the middle? >>> >>> Thanks a lot, >>> Liat >>> >> >> --------------------------------------------------------------------- >> 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