diff --git a/debian/changelog b/debian/changelog index bdb159a..9a6a9de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ukui-search (0.0.1+0127) v101; urgency=medium + + * Bugs Fixed. + + -- zhangpengfei Wed, 27 Jan 2021 14:25:07 +0800 + ukui-search (0.0.1+0126) v101; urgency=medium * Bugs Fixed. diff --git a/libsearch/index/construct-document.cpp b/libsearch/index/construct-document.cpp index af719b0..e528215 100644 --- a/libsearch/index/construct-document.cpp +++ b/libsearch/index/construct-document.cpp @@ -3,6 +3,7 @@ #include "chinese-segmentation.h" #include #include +#include //extern QList *_doc_list_path; //extern QMutex _mutex_doc_list_path; @@ -25,11 +26,6 @@ void ConstructDocumentForPath::run() // qDebug()<<_doc_list_path->size(); QString index_text = m_list.at(0); QString sourcePath = m_list.at(1); - index_text = index_text.replace(""," "); - index_text = index_text.simplified(); - - //不带多音字版 -// QString pinyin_text = FileUtils::find(QString(list.at(0)).replace(".","")).replace("", " ").simplified(); //多音字版 //现加入首字母 @@ -47,10 +43,19 @@ void ConstructDocumentForPath::run() doc.setUniqueTerm(uniqueterm); doc.addTerm(upTerm); doc.addValue(m_list.at(2)); - QStringList temp; - temp.append(index_text); - temp.append(pinyin_text_list); - doc.setIndexText(temp); +/* QStringList temp; +// temp.append(index_text); + temp.append(pinyin_text_list)*/; + doc.setIndexText(pinyin_text_list); + int postingCount = 0; + while(postingCount < index_text.size()) + { + QVector p; + p.append(postingCount); + doc.addPosting(QUrl::toPercentEncoding(index_text.at(postingCount)).toStdString(),p); + ++postingCount; + } + // QMetaObject::invokeMethod(m_indexGenerator,"appendDocListPath",Q_ARG(Document,doc)); _mutex_doc_list_path.lock(); _doc_list_path->append(doc); diff --git a/libsearch/index/file-searcher.cpp b/libsearch/index/file-searcher.cpp index 8642f37..bd99e60 100644 --- a/libsearch/index/file-searcher.cpp +++ b/libsearch/index/file-searcher.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "file-searcher.h" #include "global-settings.h" @@ -222,7 +223,7 @@ Xapian::Query FileSearcher::creatQueryForFileSearch(QString keyword, Xapian::Dat std::vector v; for(int i=0;i