From ff5e3b57786fd85ecee07d07d083ea5468039b26 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Sat, 18 Jun 2022 18:50:05 +0800 Subject: [PATCH] feat:optimize fulltext search ,skip unfinished ftx --- fulltextsearch.cc | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/fulltextsearch.cc b/fulltextsearch.cc index cb87124b..311859bc 100644 --- a/fulltextsearch.cc +++ b/fulltextsearch.cc @@ -353,25 +353,13 @@ void FullTextSearchDialog::accept() distanceBetweenWords, hasCJK, ignoreWordsOrder ) ) { -// if( hasCJK && ( mode == WholeWords || mode == PlainText ) ) -// { -// QMessageBox message( QMessageBox::Warning, -// "GoldenDict", -// tr( "CJK symbols in search string are not compatible with search modes \"Whole words\" and \"Plain text\"" ), -// QMessageBox::Ok, -// this ); -// message.exec(); -// } -// else - { - QMessageBox message( QMessageBox::Warning, - "GoldenDict", - tr( "The search line must contains at least one word containing " ) + QMessageBox message( QMessageBox::Warning, + "GoldenDict", + tr( "The search line must contains at least one word containing " ) + QString::number( MinimumWordSize ) + tr( " or more symbols" ), - QMessageBox::Ok, - this ); - message.exec(); - } + QMessageBox::Ok, + this ); + message.exec(); return; } @@ -393,6 +381,10 @@ void FullTextSearchDialog::accept() for( unsigned x = 0; x < activeDicts.size(); ++x ) { + if( !activeDicts[ x ] ->haveFTSIndex()) + { + continue; + } sptr< Dictionary::DataRequest > req = activeDicts[ x ]->getSearchResults( ui.searchLine->text(), mode,