Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 55063 invoked from network); 21 Feb 2008 13:14:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Feb 2008 13:14:47 -0000 Received: (qmail 13712 invoked by uid 500); 21 Feb 2008 13:14:36 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 13660 invoked by uid 500); 21 Feb 2008 13:14:36 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 13649 invoked by uid 99); 21 Feb 2008 13:14:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 05:14:35 -0800 X-ASF-Spam-Status: No, hits=3.1 required=10.0 tests=INVALID_DATE,MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.245.63.56] (HELO silicon.lon.periodicnetwork.com) (83.245.63.56) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 13:13:50 +0000 Received: from aksha.in (unverified [127.0.0.1]) by silicon.lon.periodicnetwork.com (Vircom SMTPRS 4.5.654.0) with ESMTP id for ; Thu, 21 Feb 2008 13:14:21 +0000 X-Modus-BlackList: 127.0.0.1=OK;srinivas.t@aksha.in=OK X-Modus-Trusted: 127.0.0.1=YES X-Modus-Audit: FALSE;0;0;22342145049719460 Message-ID: <6a256f46018b438fb939bdb90c8af539.srinivas.t@aksha.in> X-EM-APIVersion: 2, 0, 2, 6 X-Priority: 3 (Normal) Received: from 125.22.46.122 by silicon.lon.periodicnetwork.com (VIRCOM WEBMAILSVR 4.5.654) with HTTP id <6a256f46018b438fb939bdb90c8af539.srinivas.t@aksha.in> for java-dev@lucene.apache.org From: "srinivas.t@aksha.in" To: java-dev@lucene.apache.org Subject: How to delete multiple documents Date: Thu, 21 Feb 2008 13:14:21 -00 MIME-Version: 1.0 Content-type: text/plain; charset=utf-8 X-Virus-Checked: Checked by ClamAV on apache.org In the Following Code if i insert one document i was able to delete but when i insert multiple documents i was unable to delete. please follow the code and advice me thanks srinvias. // Code to index Documents for (int count = 1; count < 10; count++) { String CatID = "13"; String FieldName = "Field-" + count; document.add(Field.Text("FieldName", FieldName)); document.add(Field.Keyword("CatID", CatID)); Analyzer analyzer = new StandardAnalyzer(); IndexWriter writer = new IndexWriter(indexDirectory, analyzer, false); writer.addDocument(document); writer.optimize(); writer.close(); } //Code to delete Documents Hits objhits = null; IndexSearcher is = new IndexSearcher(LuceneHandle.indexFields); Analyzer analyzer = new StandardAnalyzer(); QueryParser parser = new QueryParser("CatID", analyzer); Query query = parser.parse("13"); objhits = is.search(query); IndexReader ir = IndexReader.open(LuceneHandle.indexFields); for(int i=0;i