Some optimization.

This commit is contained in:
iaom 2021-05-28 14:22:17 +08:00
parent bb17943e1d
commit a6d98d5085
3 changed files with 11 additions and 23 deletions

View File

@ -27,7 +27,7 @@ QMutex SearchManager::m_mutex1;
QMutex SearchManager::m_mutex2;
QMutex SearchManager::m_mutex3;
SearchManager::SearchManager(QObject *parent) : QObject(parent) {
m_pool.setMaxThreadCount(2);
m_pool.setMaxThreadCount(3);
m_pool.setExpiryTimeout(1000);
}
@ -280,29 +280,16 @@ int FileContentSearch::keywordSearchContent() {
words.append(sKeyWord.at(i).word).append(" ");
}
Xapian::Query query = qp.parse_query(words);
// Xapian::Query query = qp.parse_query(keyword.toStdString());
// QVector<SKeyWord> sKeyWord = ChineseSegmentation::getInstance()->callSegement(keyword);
// //Creat a query
// std::string words;
// for(int i=0;i<sKeyWord.size();i++)
// {
// words.append(sKeyWord.at(i).word).append(" ");
// }
// Xapian::Query query = qp.parse_query(words);
// std::vector<Xapian::Query> v;
// for(int i=0;i<sKeyWord.size();i++)
// {
// v.push_back(Xapian::Query(sKeyWord.at(i).word));
// qDebug()<<QString::fromStdString(sKeyWord.at(i).word);
// }
// Xapian::Query queryPhrase =Xapian::Query(Xapian::Query::OP_AND, v.begin(), v.end());
std::vector<Xapian::Query> v;
for(int i=0;i<sKeyWord.size();i++)
{
v.push_back(Xapian::Query(sKeyWord.at(i).word));
qDebug()<<QString::fromStdString(sKeyWord.at(i).word);
}
Xapian::Query query =Xapian::Query(Xapian::Query::OP_AND, v.begin(), v.end());
qDebug() << "keywordSearchContent:" << QString::fromStdString(query.get_description());
enquire.set_query(query);

View File

@ -67,7 +67,7 @@ unix {
INSTALLS += target
header.path = /usr/include/ukui-search
header.files += *.h index/*.h appsearch/*.h settingsearch/*.h
header.files += *.h index/*.h appsearch/*.h settingsearch/*.h plugininterface/*.h
INSTALLS += header
}

View File

@ -32,6 +32,7 @@
#include <QStyleOption>
#include <QApplication>
#include <QPainter>
#include <QPainterPath>
namespace Zeeker {
class CreateIndexAskDialog : public QDialog {