From ee2fc14311af880f56a238a66de3f67f1fe61eab Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Sat, 4 Jun 2022 23:55:04 +0800 Subject: [PATCH] fix: indexSearch should pass the searchregex the current logic will use an empty regex ,make it will match any to-be-checked article --- ftshelpers.cc | 6 +++--- ftshelpers.hh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ftshelpers.cc b/ftshelpers.cc index 2ac57cba..e155e06f 100644 --- a/ftshelpers.cc +++ b/ftshelpers.cc @@ -644,7 +644,7 @@ void FTSResultsRequest::checkArticles( QVector< uint32_t > const & offsets, void FTSResultsRequest::indexSearch( BtreeIndexing::BtreeIndex & ftsIndex, sptr< ChunkedStorage::Reader > chunks, QStringList & indexWords, - QStringList & searchWords ) + QStringList & searchWords, QRegExp & regexp ) { // Find articles which contains all requested words @@ -714,7 +714,7 @@ void FTSResultsRequest::indexSearch( BtreeIndexing::BtreeIndex & ftsIndex, dict.sortArticlesOffsetsForFTS( offsets, isCancelled ); - checkArticles( offsets, searchWords ); + checkArticles( offsets, searchWords, regexp ); } void FTSResultsRequest::combinedIndexSearch( BtreeIndexing::BtreeIndex & ftsIndex, @@ -1048,7 +1048,7 @@ void FTSResultsRequest::run() else { if( searchMode == FTS::WholeWords ) - indexSearch( ftsIndex, chunks, indexWords, searchWords ); + indexSearch( ftsIndex, chunks, indexWords, searchWords, searchRegExp ); else fullIndexSearch( ftsIndex, chunks, indexWords, searchWords, searchRegExp ); } diff --git a/ftshelpers.hh b/ftshelpers.hh index f477016d..e5c712b9 100644 --- a/ftshelpers.hh +++ b/ftshelpers.hh @@ -91,7 +91,7 @@ class FTSResultsRequest : public Dictionary::DataRequest void indexSearch( BtreeIndexing::BtreeIndex & ftsIndex, sptr< ChunkedStorage::Reader > chunks, QStringList & indexWords, - QStringList & searchWords ); + QStringList & searchWords, QRegExp & regexp ); void combinedIndexSearch( BtreeIndexing::BtreeIndex & ftsIndex, sptr< ChunkedStorage::Reader > chunks,