diff --git a/src/libtomahawk/database/FuzzyIndex.cpp b/src/libtomahawk/database/FuzzyIndex.cpp index 64db5b690..176e55ccc 100644 --- a/src/libtomahawk/database/FuzzyIndex.cpp +++ b/src/libtomahawk/database/FuzzyIndex.cpp @@ -49,15 +49,24 @@ FuzzyIndex::FuzzyIndex( QObject* parent, bool wipe ) QByteArray path = m_lucenePath.toUtf8(); const char* cPath = path.constData(); + bool failed = false; tDebug() << "Opening Lucene directory:" << path; try { - m_luceneDir = FSDirectory::getDirectory( cPath ); m_analyzer = _CLNEW SimpleAnalyzer(); + m_luceneDir = FSDirectory::getDirectory( cPath ); } catch ( CLuceneError& error ) { tDebug() << "Caught CLucene error:" << error.what(); + failed = true; + } + + if ( failed ) + { + tDebug() << "Initializing RAM directory instead."; + + m_luceneDir = _CLNEW RAMDirectory(); wipe = true; }