From lucene-user-return-370-qmlist-jakarta-archive-lucene-user=jakarta.apache.org@jakarta.apache.org Sat Nov 17 12:38:11 2001 Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 16575 invoked from network); 17 Nov 2001 12:38:11 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 17 Nov 2001 12:38:11 -0000 Received: (qmail 9778 invoked by uid 97); 17 Nov 2001 12:38:09 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 9754 invoked by uid 97); 17 Nov 2001 12:38:08 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 9741 invoked from network); 17 Nov 2001 12:38:07 -0000 Mime-Version: 1.0 X-Sender: ykingma@pop.xs4all.nl Message-Id: In-Reply-To: References: Date: Sat, 17 Nov 2001 13:35:58 +0100 To: "Lucene Users List" From: Ype Kingma Subject: Re: Enumerating all documents Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Paul, >Hello, > >Is it possible to enumerate ALL the documents in a Lucene index, say for >house-keeping purposes. Off the top of my head: for (int docNr = 0; docNr < indexReader.maxDoc(); docNr++) { if (! indexReader.isDeleted(docNr)) { Document enumeratedDoc = indexReader.document(docNr); ... } } >Thanks in advance, My pleasure. It might work, but I may have misspelled something, and my builtin Java syntax checker has not been used for quite some time. I'm currently playing with Lucene from jython: for docNr in range(indexReader.maxDoc()): if not indexReader.isDeleted(docNr): enumeratedDoc = indexReader.document(docNr) ... Have fun, Ype -- To unsubscribe, e-mail: For additional commands, e-mail: