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 5E37FD0F6 for ; Tue, 25 Sep 2012 11:06:05 +0000 (UTC) Received: (qmail 723 invoked by uid 500); 25 Sep 2012 11:06:03 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 426 invoked by uid 500); 25 Sep 2012 11:05:57 -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 386 invoked by uid 99); 25 Sep 2012 11:05:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2012 11:05:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ian.lea@gmail.com designates 209.85.223.176 as permitted sender) Received: from [209.85.223.176] (HELO mail-ie0-f176.google.com) (209.85.223.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2012 11:05:48 +0000 Received: by ieak11 with SMTP id k11so6056615iea.35 for ; Tue, 25 Sep 2012 04:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=8qDuWKsvT0Y2KhSUDrQq4q30xthP0nUiw1FVOObtBsQ=; b=Ie3hMJO4iPnM7zeQgtVu5npwbzE9mawbCO+/IHNJDv3869frUwQdwySjkodkZXX95r bTKqLrivhUunj1q/0koWbLDPePIjDA53L0dMik/8gVnqc05j6I1FKJ8m6F4wm4arbeJI DDySq1DyMwsSw924INJ+1pi2KYhoZ7MWZIxH4F2DbtSdJCXkdbyG+OnDvTKHenx2m1JG y2lR4Ysdg5HCLUlyq9KPTrHr4SqepxIlnVhblgo//LjG09wOIH/CJHaA0iwx2ZTxskCf BhotetB6NQh66Y4QS/kHv8KpFWsqa+i/eQUliif3RjAIUxrFdB+zvvsYKl4A+Jq1n9pv 6bDA== Received: by 10.50.236.72 with SMTP id us8mr7756119igc.70.1348571127689; Tue, 25 Sep 2012 04:05:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.61.2 with HTTP; Tue, 25 Sep 2012 04:05:06 -0700 (PDT) In-Reply-To: <6DE71D7664C96849BFF55AF078A233642B35A5@mailcenter.alfa.de> References: <6DE71D7664C96849BFF55AF078A233642B35A5@mailcenter.alfa.de> From: Ian Lea Date: Tue, 25 Sep 2012 12:05:06 +0100 Message-ID: Subject: Re: multireader.deleteDocuments transfer to IndexWriter.deleteDocuments ? To: java-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 So you've got a MultiReader over some number of indexes, and in order to delete stuff matched with that MultiReader you need an IndexWriter for the specific index that holds the selected term. In Lucene 4.0. Is that right? There are getSequentialSubReaders() and readerIndex(int docID) methods in the MultiReader hierarchy, and a directory() method in DirectoryReader, but that's pretty convoluted and readerIndex is protected so it may not work anyway. There's probably an easier way but I can't see it. Could you just loop round the indexes individually, opening a single reader on them one at a time? -- Ian. On Mon, Sep 24, 2012 at 12:21 PM, Naber, Peter wrote: > Hi, > > to migrate my lucene application to the new lucene Version I have to change all deprecated function to the recommended functions. > Now I am looking for a solution to migrate the "multireader.deleteDocuments(Term)" to "IndexWriter.deleteDocuments(Term)" easy. > The program has a maintenance run, which will read all Terms with a multireader and look if the original source file at the filesystem exists. If not, the Term will be delete. > Per Quarter of a year, a new index is created. > How can I determine the place of the Index in the Filesystem of a Term, to open the right index with IndexWriter to delete the Term with Indexwriter ?? > > > > > > --------------------------------------------------------------------- > 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