If you use Java 7 use this switch when starting the JVM:
Uwe Schindler an Apache Lucene PMC Member tweeted a warning earlier today as the bug affected Apache Lucene and Solr project causing wrong compilation of some loops.
The warning mail and the full story from LucidImagination:
From: Uwe SchindlerDate: Thu, 28 Jul 2011 23:13:36 +0200Subject: [WARNING] Index corruption and crashes in Apache Lucene Core / Apache Solr with Java 7
Hello Apache Lucene & Apache Solr users,Hello users of other Java-based Apache projects,
Oracle released Java 7 today. Unfortunately it contains hotspot compileroptimizations, which miscompile some loops. This can affect code of severalApache projects. Sometimes JVMs only crash, but in several cases, resultscalculated can be incorrect, leading to bugs in applications (see Hotspotbugs 7070134 , 7044738 , 7068051 ).
Apache Lucene Core and Apache Solr are two Apache projects, which areaffected by these bugs, namely all versions released until today. Solr userswith the default configuration will have Java crashing with SIGSEGV as soonas they start to index documents, as one affected part is the well-knownPorter stemmer (see LUCENE-3335 ). Other loops in Lucene may bemiscompiled, too, leading to index corruption (especially on Lucene trunkwith pulsing codec; other loops may be affected, too - LUCENE-3346 ).
These problems were detected only 5 days before the official Java 7 release,so Oracle had no time to fix those bugs, affecting also many moreapplications. In response to our questions, they proposed to include thefixes into service release u2 (eventually into service release u1, see ).This means you cannot use Apache Lucene/Solr with Java 7 releases beforeUpdate 2! If you do, please don't open bug reports, it is not thecommitters' fault! At least disable loop optimizations using the-XX:-UseLoopPredicate JVM option to not risk index corruptions.
Please note: Also Java 6 users are affected, if they use one of those JVMoptions, which are not enabled by default: -XX:+OptimizeStringConcat or-XX:+AggressiveOpts
It is strongly recommended not to use any hotspot optimization switches inany Java version without extensive testing!
In case you upgrade to Java 7, remember that you may have to reindex, as theunicode version shipped with Java 7 changed and tokenization behavesdifferently (e.g. lowercasing). For more information, readJRE_VERSION_MIGRATION.txt in your distribution package!
On behalf of the Lucene project,Uwe
 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7070134 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7044738 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7068051 https://issues.apache.org/jira/browse/LUCENE-3335 https://issues.apache.org/jira/browse/LUCENE-3346 http://s.apache.org/StQ
Better play safe and expect an update form Oracle i guess...