diff --git a/libsearch/index/file-searcher.cpp b/libsearch/index/file-searcher.cpp index 707e435..8642f37 100644 --- a/libsearch/index/file-searcher.cpp +++ b/libsearch/index/file-searcher.cpp @@ -58,7 +58,7 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult int num = 5; int resultCount = 0; int total = 0; - while(total<20) + while(total < 100) { resultCount = keywordSearchfile(uniqueSymbol1,keyword,"0",1,begin,num); if(resultCount == 0 || resultCount == -1) @@ -68,7 +68,7 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult } return; }); -// Q_EMIT this->resultFile(m_search_result_file); + // Q_EMIT this->resultFile(m_search_result_file); //dir QtConcurrent::run([&, uniqueSymbol2, keyword](){ if(!m_search_result_dir->isEmpty()) @@ -77,7 +77,7 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult int num = 5; int resultCount = 0; int total = 0; - while(total<20) + while(total<100) { resultCount = keywordSearchfile(uniqueSymbol2,keyword,"1",1,begin,num); if(resultCount == 0 || resultCount == -1) @@ -87,7 +87,7 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult } return; }); -// Q_EMIT this->resultDir(m_search_result_dir); + // Q_EMIT this->resultDir(m_search_result_dir); //content QtConcurrent::run([&, uniqueSymbol3, keyword](){ if(!m_search_result_content->isEmpty()) @@ -97,7 +97,7 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult int resultCount = 0; int total = 0; - while(total<20) + while(total<50) { resultCount = keywordSearchContent(uniqueSymbol3,keyword,begin,num); if(resultCount == 0 || resultCount == -1) @@ -107,14 +107,14 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult } return; }); -// Q_EMIT this->resultContent(m_search_result_content); + // Q_EMIT this->resultContent(m_search_result_content); } int FileSearcher::keywordSearchfile(size_t uniqueSymbol, QString keyword, QString value, unsigned slot, int begin, int num) { try { - qDebug()<<"--keywordSearchfile start--"; + qDebug() << "--keywordSearchfile start--"; Xapian::Database db(INDEX_PATH); Xapian::Query query = creatQueryForFileSearch(keyword,db); Xapian::Enquire enquire(db); @@ -131,11 +131,11 @@ int FileSearcher::keywordSearchfile(size_t uniqueSymbol, QString keyword, QStrin queryFile = query; } - qDebug()<<"keywordSearchfile:"<(result.get_matches_estimated()); + Xapian::MSet result = enquire.get_mset(begin, num); + int resultCount = result.size(); qDebug()<< "keywordSearchfile results count=" < v; -// for(int i=0;i v; + // for(int i=0;i(result.get_matches_estimated()); + Xapian::MSet result = enquire.get_mset(begin, num); + int resultCount = result.size(); if(result.size() == 0) return 0; qDebug()<< "keywordSearchContent results count=" < v; for(int i=0;iappend(QString::fromStdString(data)); + // pathTobeDelete->append(QString::fromStdString(data)); qDebug()<setValue(INDEX_DATABASE_STATE,"0"); GlobalSettings::getInstance()->setValue(CONTENT_INDEX_DATABASE_STATE,"0"); }