Hi, Have a look at:
http://lucene.apache.org/core/4_1_0/core/org/apache/lucene/index/CheckIndex.html HTH, Dmitry On Mon, Mar 24, 2014 at 8:16 PM, zqzuk <ziqizh...@hotmail.co.uk> wrote: > My Lucene index - built with Solr using Lucene4.1 - is corrupted. Upon > trying > to read the index using the following code I get > org.apache.solr.common.SolrException: No such core: collection1 exception: > > >> > File configFile = new File(cacheFolder + File.separator + "solr.xml"); > CoreContainer container = new CoreContainer(cacheFolder, configFile); > SolrServer server = new EmbeddedSolrServer(container, "collection1"); > ModifiableSolrParams params = new ModifiableSolrParams(); > params.set("q", idFieldName + ":" + ClientUtils.escapeQueryChars(queryId)); > params.set("fl",idFieldName+","+valueFieldName); > > QueryResponse response = server.query(params) > >> > > I used "checkindex" util to check the integrity of the index and it seems > not able to perform the task by throwing the following error: > > >> > Opening index @ > /....../solrindex_cache/zookeeper/solr/collection1/data/index > > ERROR: could not read any segments file in directory > java.io.FileNotFoundException: > /....../solrindex_cache/zookeeper/solr/collection1/data/index/segments_b5tb > (No such file or directory) > at java.io.RandomAccessFile.open(Native Method) > at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233) > at > org.apache.lucene.store.MMapDirectory.openInput(MMapDirectory.java:223) > at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:285) > at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:347) > at > > org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:783) > at > > org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:630) > at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:343) > at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:383) > at org.apache.lucene.index.CheckIndex.main(CheckIndex.java:1777) > >> > > The file segments_b5tb that index checker is looking for is indeed missing > in the index folder. The only file that looks similar is segments.gen. > However, the index segment files including .si, tip, doc, fdx etc still > exist. > > Is there any way to fix this as it took me 2 weeks to build this index... > > Many many thanks for your kind advice! > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Fixing-corrupted-index-tp4126644.html > Sent from the Solr - User mailing list archive at Nabble.com. > -- Dmitry Blog: http://dmitrykan.blogspot.com Twitter: http://twitter.com/dmitrykan