Fix:Term pos error when creat Xapian document.

This commit is contained in:
iaom 2021-10-19 09:40:57 +08:00
parent 2e91cdd9a7
commit d5ebf5a985
1 changed files with 6 additions and 7 deletions

View File

@ -69,14 +69,13 @@ void ConstructDocumentForPath::run() {
/* QStringList temp;
// temp.append(index_text);
temp.append(pinyin_text_list)*/;
int postingCount = 0;
while(postingCount < index_text.size()) {
// QVector<size_t> p;
// p.append(postingCount);
doc.addPosting(QUrl::toPercentEncoding(index_text.at(postingCount)).toStdString(), postingCount);
++postingCount;
}
int i = 0;
int postingCount = 1; //terms post of Xapian document is start from 1!
while(postingCount < index_text.size()) {
doc.addPosting(QUrl::toPercentEncoding(index_text.at(i)).toStdString(), postingCount);
++postingCount;
++i;
}
for(QString& s : pinyin_text_list) {
i = 0;
while(i < s.size()) {