|
|
-
Solr 3x segments file and deleting index
Burton-West, Tom 2010-12-01, 17:12
If I want to delete an entire index and start over, in previous versions of Solr, you could stop Solr, delete all files in the index directory and restart Solr. Solr would then create empty segments files and you could start indexing. In Solr 3x if I delete all the files in the index directory I get a large stack trace with this error:
org.apache.lucene.index.IndexNotFoundException: no segments* file found
As a workaround, whenever I delete an index (by deleting all files in the index directory), I copy the segments files that come with the Solr example to the index directory and then restart Solr.
Is this a feature or a bug? What is the rationale?
Tom
Tom Burton-West
+
Burton-West, Tom 2010-12-01, 17:12
-
Re: Solr 3x segments file and deleting index
Shawn Heisey 2010-12-01, 17:45
On 12/1/2010 10:12 AM, Burton-West, Tom wrote: > If I want to delete an entire index and start over, in previous versions of Solr, you could stop Solr, delete all files in the index directory and restart Solr. Solr would then create empty segments files and you could start indexing. In Solr 3x if I delete all the files in the index directory I get a large stack trace with this error:
You have to delete the index directory entirely. This looks like a change in Lucene, not Solr specificially. If the directory exists, but has nothing in it, it throws an exception. I'll leave the rationale question that you also asked to someone who might actually know. I personally think it shouldn't behave this way, but the dev team may encountered something that required that the directory either be a valid index or not exist at all.
Shawn
+
Shawn Heisey 2010-12-01, 17:45
-
Re: Solr 3x segments file and deleting index
Chris Hostetter 2010-12-10, 00:07
: > If I want to delete an entire index and start over, in previous versions of : > Solr, you could stop Solr, delete all files in the index directory and : > restart Solr. Solr would then create empty segments files and you could ... : You have to delete the index directory entirely. This looks like a change in : Lucene, not Solr specificially. If the directory exists, but has nothing in : it, it throws an exception. I'll leave the rationale question that you also
FYI: this has always been the behavior in Solr (i just verified it in 1.4.1, and 1.3 .. didn't bother going back to 1.2 and 1.1). -Hoss
+
Chris Hostetter 2010-12-10, 00:07
|
|