From 828dff3bb1cee10fc24a84a6941c122aeac7b47d Mon Sep 17 00:00:00 2001 From: dockes Date: Mon, 29 Sep 2008 08:59:20 +0000 Subject: [PATCH] doc.pc now only place where relevancy is stored --- src/kde/kioslave/recoll/kio_recoll.cpp | 7 +++---- src/python/recoll/pyrecoll.cpp | 11 +++++------ src/qtgui/reslist.cpp | 16 ++++++++-------- src/query/docseq.cpp | 5 ++--- src/query/docseq.h | 12 ++---------- src/query/docseqdb.cpp | 6 +++--- src/query/docseqdb.h | 4 ++-- src/query/docseqhist.cpp | 9 +++------ src/query/docseqhist.h | 4 ++-- src/query/filtseq.cpp | 12 ++++-------- src/query/filtseq.h | 4 ++-- src/query/recollq.cpp | 7 +++---- src/query/sortseq.cpp | 10 +++------- src/query/sortseq.h | 4 ++-- src/rcldb/rcldb.cpp | 11 +++++------ src/rcldb/rcldb.h | 4 ++-- src/rcldb/rclquery.cpp | 6 ++---- src/rcldb/rclquery.h | 4 ++-- 18 files changed, 55 insertions(+), 81 deletions(-) diff --git a/src/kde/kioslave/recoll/kio_recoll.cpp b/src/kde/kioslave/recoll/kio_recoll.cpp index b5a46045..d6a951b2 100644 --- a/src/kde/kioslave/recoll/kio_recoll.cpp +++ b/src/kde/kioslave/recoll/kio_recoll.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: kio_recoll.cpp,v 1.8 2008-06-13 18:22:46 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: kio_recoll.cpp,v 1.9 2008-09-29 08:59:20 dockes Exp $ (C) 2005 J.F.Dockes"; #endif #include @@ -139,8 +139,7 @@ void RecollProtocol::get(const KURL & url) string sh; doc.erase(); - int percent; - if (!m_docsource->getDoc(i, doc, &percent, &sh)) { + if (!m_docsource->getDoc(i, doc, &sh)) { // This may very well happen for history if the doc has // been removed since. So don't treat it as fatal. doc.meta["abstract"] = string("Unavailable document"); @@ -158,7 +157,7 @@ void RecollProtocol::get(const KURL & url) result = "

"; char perbuf[10]; - sprintf(perbuf, "%3d%%", percent); + sprintf(perbuf, "%3d%%", doc.pc); if (doc.meta["title"].empty()) doc.meta["title"] = path_getsimple(doc.url); char datebuf[100]; diff --git a/src/python/recoll/pyrecoll.cpp b/src/python/recoll/pyrecoll.cpp index 5fc7c572..18cb58ad 100644 --- a/src/python/recoll/pyrecoll.cpp +++ b/src/python/recoll/pyrecoll.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: pyrecoll.cpp,v 1.14 2008-09-29 06:58:25 dockes Exp $ (C) 2007 J.F.Dockes"; +static char rcsid[] = "@(#$Id: pyrecoll.cpp,v 1.15 2008-09-29 08:59:20 dockes Exp $ (C) 2007 J.F.Dockes"; #endif @@ -618,7 +618,7 @@ Query_execute(recoll_QueryObject* self, PyObject *args, PyObject *kwargs) return 0; } RefCntr rq(sd); - rq->setSortBy(self->sortfield, self->ascending); + self->query->setSortBy(self->sortfield, self->ascending); self->query->setQuery(rq, dostem?Rcl::Query::QO_STEM:Rcl::Query::QO_NONE); int cnt = self->query->getResCnt(); self->next = 0; @@ -647,7 +647,7 @@ Query_executesd(recoll_QueryObject* self, PyObject *args, PyObject *kwargs) PyErr_SetString(PyExc_AttributeError, "query"); return 0; } - pysd->sd->setSortBy(self->sortfield, self->ascending); + self->query->setSortBy(self->sortfield, self->ascending); self->query->setQuery(pysd->sd, dostem ? Rcl::Query::QO_STEM : Rcl::Query::QO_NONE); int cnt = self->query->getResCnt(); @@ -681,8 +681,7 @@ Query_fetchone(recoll_QueryObject* self, PyObject *, PyObject *) LOGERR(("Query_fetchone: couldn't create doc object for result\n")); return 0; } - int percent; - if (!self->query->getDoc(self->next, *result->doc, &percent)) { + if (!self->query->getDoc(self->next, *result->doc)) { PyErr_SetString(PyExc_EnvironmentError, "query: cant fetch result"); self->next = -1; return 0; @@ -702,7 +701,7 @@ Query_fetchone(recoll_QueryObject* self, PyObject *, PyObject *) doc->meta[Rcl::Doc::keyfs] = doc->fbytes; doc->meta[Rcl::Doc::keyds] = doc->dbytes; char pc[20]; - sprintf(pc, "%02d %%", percent); + sprintf(pc, "%02d %%", doc->pc); doc->meta[Rcl::Doc::keyrr] = pc; return (PyObject *)result; diff --git a/src/qtgui/reslist.cpp b/src/qtgui/reslist.cpp index bfb08b74..c5d83fe9 100644 --- a/src/qtgui/reslist.cpp +++ b/src/qtgui/reslist.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: reslist.cpp,v 1.45 2008-09-28 14:20:50 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: reslist.cpp,v 1.46 2008-09-29 08:59:20 dockes Exp $ (C) 2005 J.F.Dockes"; #endif #include @@ -474,15 +474,19 @@ void ResList::resultPageNext() // setUpdatesEnabled(false); for (int i = 0; i < pagelen; i++) { - int &percent(respage[i].percent); Rcl::Doc &doc(respage[i].doc); string& sh(respage[i].subHeader); - - if (percent == -1) { + int percent; + if (doc.pc == -1) { percent = 0; // Document not available, maybe other further, will go on. doc.meta[Rcl::Doc::keyabs] = string(tr("Unavailable document").utf8()); + } else { + percent = doc.pc; } + // Percentage of 'relevance' + char perbuf[10]; + sprintf(perbuf, "%3d%% ", percent); // Determine icon to display if any string img_name; @@ -496,10 +500,6 @@ void ResList::resultPageNext() setImage(img_name.c_str(), image); } - // Percentage of 'relevance' - char perbuf[10]; - sprintf(perbuf, "%3d%% ", percent); - // Printable url: either utf-8 if transcoding succeeds, or url-encoded string url; printableUrl(rclconfig->getDefCharset(), doc.url, url); diff --git a/src/query/docseq.cpp b/src/query/docseq.cpp index 40456272..e3159813 100644 --- a/src/query/docseq.cpp +++ b/src/query/docseq.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: docseq.cpp,v 1.10 2007-01-19 10:32:39 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: docseq.cpp,v 1.11 2008-09-29 08:59:20 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -27,8 +27,7 @@ int DocSequence::getSeqSlice(int offs, int cnt, vector& result) int ret = 0; for (int num = offs; num < offs + cnt; num++, ret++) { result.push_back(ResListEntry()); - if (!getDoc(num, result.back().doc, &result.back().percent, - &result.back().subHeader)) { + if (!getDoc(num, result.back().doc, &result.back().subHeader)) { result.pop_back(); return ret; } diff --git a/src/query/docseq.h b/src/query/docseq.h index 7b67ffcd..a7eb4037 100644 --- a/src/query/docseq.h +++ b/src/query/docseq.h @@ -16,7 +16,7 @@ */ #ifndef _DOCSEQ_H_INCLUDED_ #define _DOCSEQ_H_INCLUDED_ -/* @(#$Id: docseq.h,v 1.15 2008-09-28 07:40:56 dockes Exp $ (C) 2004 J.F.Dockes */ +/* @(#$Id: docseq.h,v 1.16 2008-09-29 08:59:20 dockes Exp $ (C) 2004 J.F.Dockes */ #include #include #include @@ -31,9 +31,7 @@ using std::vector; // A result list entry. struct ResListEntry { Rcl::Doc doc; - int percent; string subHeader; - ResListEntry() : percent(0) {} }; /** Interface for a list of documents coming from some source. @@ -50,17 +48,11 @@ class DocSequence { * * @param num document rank in sequence * @param doc return data - * @param percent this will be updated with the percentage of relevance, if - * available, depending on the type of sequence. Return -1 in there - * to indicate that the specified document data is - * unavailable but that there may be available data further - * in the sequence * @param sh subheader to display before this result (ie: date change * inside history) * @return true if ok, false for error or end of data */ - virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0) - = 0; + virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0) = 0; /** Get next page of documents. This accumulates entries into the result * list (doesn't reset it). */ diff --git a/src/query/docseqdb.cpp b/src/query/docseqdb.cpp index 1db607a8..001ca67e 100644 --- a/src/query/docseqdb.cpp +++ b/src/query/docseqdb.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: docseqdb.cpp,v 1.6 2008-09-28 07:40:56 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: docseqdb.cpp,v 1.7 2008-09-29 08:59:20 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -45,10 +45,10 @@ string DocSequenceDb::getDescription() return m_sdata->getDescription(); } -bool DocSequenceDb::getDoc(int num, Rcl::Doc &doc, int *percent, string *sh) +bool DocSequenceDb::getDoc(int num, Rcl::Doc &doc, string *sh) { if (sh) sh->erase(); - return m_q->getDoc(num, doc, percent); + return m_q->getDoc(num, doc); } int DocSequenceDb::getResCnt() diff --git a/src/query/docseqdb.h b/src/query/docseqdb.h index 6a3ae067..86f6b56e 100644 --- a/src/query/docseqdb.h +++ b/src/query/docseqdb.h @@ -16,7 +16,7 @@ */ #ifndef _DOCSEQDB_H_INCLUDED_ #define _DOCSEQDB_H_INCLUDED_ -/* @(#$Id: docseqdb.h,v 1.4 2008-09-28 07:40:56 dockes Exp $ (C) 2004 J.F.Dockes */ +/* @(#$Id: docseqdb.h,v 1.5 2008-09-29 08:59:20 dockes Exp $ (C) 2004 J.F.Dockes */ #include "docseq.h" #include "refcntr.h" @@ -30,7 +30,7 @@ class DocSequenceDb : public DocSequence { DocSequenceDb(RefCntr q, const string &t, RefCntr sdata); virtual ~DocSequenceDb(); - virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string * = 0); + virtual bool getDoc(int num, Rcl::Doc &doc, string * = 0); virtual int getResCnt(); virtual bool getTerms(vector& terms, vector >& groups, diff --git a/src/query/docseqhist.cpp b/src/query/docseqhist.cpp index 53623591..56094bb5 100644 --- a/src/query/docseqhist.cpp +++ b/src/query/docseqhist.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: docseqhist.cpp,v 1.3 2008-07-28 12:24:15 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: docseqhist.cpp,v 1.4 2008-09-29 08:59:20 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -25,8 +25,7 @@ static char rcsid[] = "@(#$Id: docseqhist.cpp,v 1.3 2008-07-28 12:24:15 dockes E #include "rcldb.h" #include "fileudi.h" -bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, int *percent, - string *sh) +bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, string *sh) { // Retrieve history list if (!m_hist) @@ -47,8 +46,6 @@ bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, int *percent, m_prevnum = num; while (skip--) m_it++; - if (percent) - *percent = 100; if (sh) { if (m_prevtime < 0 || abs (float(m_prevtime) - float(m_it->unixtime)) > 86400) { m_prevtime = m_it->unixtime; @@ -61,7 +58,7 @@ bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, int *percent, } string udi; make_udi(m_it->fn, m_it->ipath, udi); - bool ret = m_db->getDoc(udi, doc, percent); + bool ret = m_db->getDoc(udi, doc); if (!ret) { doc.url = string("file://") + m_it->fn; doc.ipath = m_it->ipath; diff --git a/src/query/docseqhist.h b/src/query/docseqhist.h index 0f5633ce..a9ea8f63 100644 --- a/src/query/docseqhist.h +++ b/src/query/docseqhist.h @@ -16,7 +16,7 @@ */ #ifndef _DOCSEQHIST_H_INCLUDED_ #define _DOCSEQHIST_H_INCLUDED_ -/* @(#$Id: docseqhist.h,v 1.2 2007-01-19 15:22:50 dockes Exp $ (C) 2004 J.F.Dockes */ +/* @(#$Id: docseqhist.h,v 1.3 2008-09-29 08:59:20 dockes Exp $ (C) 2004 J.F.Dockes */ #include "docseq.h" #include "history.h" @@ -34,7 +34,7 @@ class DocSequenceHistory : public DocSequence { : DocSequence(t), m_db(d), m_hist(h), m_prevnum(-1), m_prevtime(-1) {} virtual ~DocSequenceHistory() {} - virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0); + virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0); virtual int getResCnt(); virtual string getDescription() {return m_description;} void setDescription(const string& desc) {m_description = desc;} diff --git a/src/query/filtseq.cpp b/src/query/filtseq.cpp index 71714ca2..30406cf3 100644 --- a/src/query/filtseq.cpp +++ b/src/query/filtseq.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: filtseq.cpp,v 1.1 2008-09-28 07:40:56 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: filtseq.cpp,v 1.2 2008-09-29 08:59:20 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -47,7 +47,7 @@ DocSeqFiltered::DocSeqFiltered(RefCntr iseq, { } -bool DocSeqFiltered::getDoc(int idx, Rcl::Doc &doc, int *percent, string *) +bool DocSeqFiltered::getDoc(int idx, Rcl::Doc &doc, string *) { LOGDEB1(("DocSeqFiltered: fetching %d\n", idx)); @@ -61,23 +61,19 @@ bool DocSeqFiltered::getDoc(int idx, Rcl::Doc &doc, int *percent, string *) // Loop until we get enough docs Rcl::Doc tdoc; - int pc; int i = 0; while (idx >= (int)m_dbindices.size()) { - if (!m_seq->getDoc(backend_idx, tdoc, &pc)) + if (!m_seq->getDoc(backend_idx, tdoc)) return false; if (filter(m_spec, &tdoc)) { m_dbindices.push_back(backend_idx); } backend_idx++; } - - if (percent) - *percent = pc; doc = tdoc; } else { // The corresponding backend indice is already known - if (!m_seq->getDoc(m_dbindices[idx], doc, percent)) + if (!m_seq->getDoc(m_dbindices[idx], doc)) return false; } return true; diff --git a/src/query/filtseq.h b/src/query/filtseq.h index dc20a980..7e9abab7 100644 --- a/src/query/filtseq.h +++ b/src/query/filtseq.h @@ -16,7 +16,7 @@ */ #ifndef _FILTSEQ_H_INCLUDED_ #define _FILTSEQ_H_INCLUDED_ -/* @(#$Id: filtseq.h,v 1.2 2008-09-28 14:20:50 dockes Exp $ (C) 2004 J.F.Dockes */ +/* @(#$Id: filtseq.h,v 1.3 2008-09-29 08:59:20 dockes Exp $ (C) 2004 J.F.Dockes */ #include #include @@ -47,7 +47,7 @@ class DocSeqFiltered : public DocSequence { DocSeqFiltered(RefCntr iseq, DocSeqFiltSpec &filtspec, const std::string &t); virtual ~DocSeqFiltered() {} - virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0); + virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0); virtual int getResCnt() {return m_seq->getResCnt();} virtual string getAbstract(Rcl::Doc& doc) { return m_seq->getAbstract(doc); diff --git a/src/query/recollq.cpp b/src/query/recollq.cpp index 251fc03f..91b19178 100644 --- a/src/query/recollq.cpp +++ b/src/query/recollq.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: recollq.cpp,v 1.17 2008-09-29 06:58:25 dockes Exp $ (C) 2006 J.F.Dockes"; +static char rcsid[] = "@(#$Id: recollq.cpp,v 1.18 2008-09-29 08:59:20 dockes Exp $ (C) 2006 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -239,16 +239,15 @@ int recollq(RclConfig **cfp, int argc, char **argv) string tmpdir; for (int i = 0; i < limit; i++) { - int pc; Rcl::Doc doc; - if (!query.getDoc(i, doc, &pc)) + if (!query.getDoc(i, doc)) break; if (op_flags & OPT_b) { cout << doc.url.c_str() << endl; } else { char cpc[20]; - sprintf(cpc, "%d", pc); + sprintf(cpc, "%d", doc.pc); cout << doc.mimetype.c_str() << "\t" << "[" << doc.url.c_str() << "]" << "\t" diff --git a/src/query/sortseq.cpp b/src/query/sortseq.cpp index c1594054..ff537e66 100644 --- a/src/query/sortseq.cpp +++ b/src/query/sortseq.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: sortseq.cpp,v 1.12 2008-09-28 14:20:50 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: sortseq.cpp,v 1.13 2008-09-29 08:59:20 dockes Exp $ (C) 2005 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -91,12 +91,10 @@ DocSeqSorted::DocSeqSorted(RefCntr iseq, DocSeqSortSpec &sortspec, m_docs.resize(m_spec.sortdepth); int i; for (i = 0; i < m_spec.sortdepth; i++) { - int percent; - if (!iseq->getDoc(i, m_docs[i], &percent)) { + if (!iseq->getDoc(i, m_docs[i])) { LOGERR(("DocSeqSorted: getDoc failed for doc %d\n", i)); break; } - m_docs[i].pc = percent; } m_spec.sortdepth = i; LOGDEB(("DocSeqSorted:: m_count %d\n", m_spec.sortdepth)); @@ -109,14 +107,12 @@ DocSeqSorted::DocSeqSorted(RefCntr iseq, DocSeqSortSpec &sortspec, sort(m_docsp.begin(), m_docsp.end(), cmp); } -bool DocSeqSorted::getDoc(int num, Rcl::Doc &doc, int *percent, string *) +bool DocSeqSorted::getDoc(int num, Rcl::Doc &doc, string *) { LOGDEB1(("DocSeqSorted: fetching %d\n", num)); if (num >= m_spec.sortdepth) return false; - if (percent) - *percent = (*m_docsp[num]).pc; doc = *m_docsp[num]; return true; } diff --git a/src/query/sortseq.h b/src/query/sortseq.h index 7f781a70..b2a4fb64 100644 --- a/src/query/sortseq.h +++ b/src/query/sortseq.h @@ -16,7 +16,7 @@ */ #ifndef _SORTSEQ_H_INCLUDED_ #define _SORTSEQ_H_INCLUDED_ -/* @(#$Id: sortseq.h,v 1.11 2008-09-28 14:20:50 dockes Exp $ (C) 2004 J.F.Dockes */ +/* @(#$Id: sortseq.h,v 1.12 2008-09-29 08:59:20 dockes Exp $ (C) 2004 J.F.Dockes */ #include #include @@ -48,7 +48,7 @@ class DocSeqSorted : public DocSequence { DocSeqSorted(RefCntr iseq, DocSeqSortSpec &sortspec, const std::string &t); virtual ~DocSeqSorted() {} - virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0); + virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0); virtual int getResCnt() {return m_spec.sortdepth;} virtual string getAbstract(Rcl::Doc& doc) { return m_seq->getAbstract(doc); diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index 70322dec..e17183c2 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.145 2008-09-16 08:18:30 dockes Exp $ (C) 2004 J.F.Dockes"; +static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.146 2008-09-29 08:59:20 dockes Exp $ (C) 2004 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -159,6 +159,7 @@ bool Db::Native::dbDataToRclDoc(Xapian::docid docid, std::string &data, } char buf[20]; sprintf(buf,"%.2f", float(percent) / 100.0); + doc.pc = percent; doc.meta[Doc::keyrr] = buf; parms.get(Doc::keyipt, doc.ipath); parms.get(Doc::keyfs, doc.fbytes); @@ -1554,7 +1555,7 @@ bool Db::makeDocAbstract(Doc &doc, Query *query, string& abstract) } // Retrieve document defined by file name and internal path. -bool Db::getDoc(const string &udi, Doc &doc, int *pc) +bool Db::getDoc(const string &udi, Doc &doc) { LOGDEB(("Db:getDoc: [%s]\n", udi.c_str())); if (m_ndb == 0) @@ -1562,8 +1563,7 @@ bool Db::getDoc(const string &udi, Doc &doc, int *pc) // Initialize what we can in any case. If this is history, caller // will make partial display in case of error - if (*pc) - *pc = 100; + doc.pc = 100; string uniterm = make_uniterm(udi); string ermsg; @@ -1572,8 +1572,7 @@ bool Db::getDoc(const string &udi, Doc &doc, int *pc) // Document found in history no longer in the database. // We return true (because their might be other ok docs further) // but indicate the error with pc = -1 - if (*pc) - *pc = -1; + doc.pc = -1; LOGINFO(("Db:getDoc: no such doc in index: [%s] (len %d)\n", uniterm.c_str(), uniterm.length())); return true; diff --git a/src/rcldb/rcldb.h b/src/rcldb/rcldb.h index 10a73977..e3eee3cc 100644 --- a/src/rcldb/rcldb.h +++ b/src/rcldb/rcldb.h @@ -16,7 +16,7 @@ */ #ifndef _DB_H_INCLUDED_ #define _DB_H_INCLUDED_ -/* @(#$Id: rcldb.h,v 1.62 2008-09-16 08:18:30 dockes Exp $ (C) 2004 J.F.Dockes */ +/* @(#$Id: rcldb.h,v 1.63 2008-09-29 08:59:20 dockes Exp $ (C) 2004 J.F.Dockes */ #include #include @@ -174,7 +174,7 @@ class Db { * * Used by the 'history' feature (and nothing else?) */ - bool getDoc(const string &udi, Doc &doc, int *percent); + bool getDoc(const string &udi, Doc &doc); /* The following are mainly for the aspell module */ /** Whole term list walking. */ diff --git a/src/rcldb/rclquery.cpp b/src/rcldb/rclquery.cpp index ebad19d8..ec548104 100644 --- a/src/rcldb/rclquery.cpp +++ b/src/rcldb/rclquery.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: rclquery.cpp,v 1.7 2008-09-29 06:58:25 dockes Exp $ (C) 2008 J.F.Dockes"; +static char rcsid[] = "@(#$Id: rclquery.cpp,v 1.8 2008-09-29 08:59:20 dockes Exp $ (C) 2008 J.F.Dockes"; #endif #include @@ -278,7 +278,7 @@ int Query::getResCnt() // maintain a correspondance from the sequential external index // sequence to the internal Xapian hole-y one (the holes being the documents // that dont match the filter). -bool Query::getDoc(int exti, Doc &doc, int *percent) +bool Query::getDoc(int exti, Doc &doc) { LOGDEB1(("Query::getDoc: exti %d\n", exti)); if (ISNULL(m_nq) || !m_nq->enquire) { @@ -364,8 +364,6 @@ bool Query::getDoc(int exti, Doc &doc, int *percent) Xapian::Document xdoc = m_nq->mset[xapi-first].get_document(); Xapian::docid docid = *(m_nq->mset[xapi-first]); int pc = m_nq->mset.convert_to_percent(m_nq->mset[xapi-first]); - if (percent) - *percent = pc; // Parse xapian document's data and populate doc fields string data = xdoc.get_data(); diff --git a/src/rcldb/rclquery.h b/src/rcldb/rclquery.h index 85619a37..0966868b 100644 --- a/src/rcldb/rclquery.h +++ b/src/rcldb/rclquery.h @@ -1,6 +1,6 @@ #ifndef _rclquery_h_included_ #define _rclquery_h_included_ -/* @(#$Id: rclquery.h,v 1.4 2008-09-29 06:58:25 dockes Exp $ (C) 2008 J.F.Dockes */ +/* @(#$Id: rclquery.h,v 1.5 2008-09-29 08:59:20 dockes Exp $ (C) 2008 J.F.Dockes */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,7 +70,7 @@ class Query { int getResCnt(); /** Get document at rank i in current query results. */ - bool getDoc(int i, Doc &doc, int *percent = 0); + bool getDoc(int i, Doc &doc); /** Get possibly expanded list of query terms */ bool getQueryTerms(list& terms);