Unfortunately, you can't easily recover from this (except by reindexing your docs again).
Failing to call IW.commit() or IW.close() means no segments file was written... It is theoretically possible to reconstruct a segments file by "listing" all files and figuring out which segments there are, deriving the right metadata for them, etc., but I don't think anyone has actually built this yet. Mike http://blog.mikemccandless.com On Mon, Mar 21, 2011 at 2:05 AM, Kevin Tse <i...@neevek.net> wrote: > Hi, experts > > I had a program running for 2 days to build an index for around 160 million > text files, and after program ended, I tried searching the index and found > the index was not correctly built, *indexReader.numDocs()* returns 0. I > checked the index directory, it looked good, all the index data seemed to be > there, the directory is 1.5 Gigabytes in size. > > I checked my code and found that I forgot to call *indexWriter.optimize()*and > *indexWriter.close()*, I want to know if it is possible to > *re-optimize()*the index so I don't need to rebuild the whole index > from scratch? I don't > really want the program to take another 2 days. > > Thanks! > > -- > Neevek Est > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org