Fix:Term pos error when creat Xapian document.
This commit is contained in:
parent
2e91cdd9a7
commit
d5ebf5a985
|
@ -69,14 +69,13 @@ void ConstructDocumentForPath::run() {
|
||||||
/* QStringList temp;
|
/* QStringList temp;
|
||||||
// temp.append(index_text);
|
// temp.append(index_text);
|
||||||
temp.append(pinyin_text_list)*/;
|
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 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) {
|
for(QString& s : pinyin_text_list) {
|
||||||
i = 0;
|
i = 0;
|
||||||
while(i < s.size()) {
|
while(i < s.size()) {
|
||||||
|
|
Loading…
Reference in New Issue