Thanks- Yes in my use-case there are never any deleted documents when the search is run- (deletion takes place in a pre-processing stage)
Toke Eskildsen <t...@statsbiblioteket.dk> wrote on 12/17/2008 08:16:31 AM: > On Mon, 2008-12-08 at 15:17 +0100, Donna L Gresh wrote: > > public Vector getIndexIds() throws Exception { > > > > Vector vec = new Vector(); > > IndexReader ireader = IndexReader.open(directoryName); > > int numdocs = ireader.numDocs(); > > for (int i=0; i<numdocs; i++) { > > Document doc = ireader.document(i); > > It's probably best to perform a check for ireader.isDeleted(i) here, > unless the index never contains deleted documents. > > > Field field = doc.getField("empid"); > > if (field==null) { > > continue; > > } > > String contents = field.stringValue(); > > vec.add(contents); > > } > > return vec; > > } > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org >