diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index 22ab241d..0f8dc4ec 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -677,6 +677,10 @@ public: // and remember relative. m_ts->curpos = pos; pos += m_ts->basepos; + // Don't try to add empty term Xapian doesnt like it... Safety check + // this should not happen. + if (term.empty()) + return true; string ermsg; try { // Index without prefix, using the field-specific weighting diff --git a/src/rcldb/termproc.h b/src/rcldb/termproc.h index dcd095f0..33c18f89 100644 --- a/src/rcldb/termproc.h +++ b/src/rcldb/termproc.h @@ -131,7 +131,14 @@ public: } return true; } - return TermProc::takeword(otrm, pos, bs, be); + // It may happen in some weird cases that the output from unac is + // empty (if the word actually consisted entirely of diacritics ...) + // The consequence is that a phrase search won't work without addional + // slack. + if (otrm.empty()) + return true; + else + return TermProc::takeword(otrm, pos, bs, be); } virtual bool flush()