|
a/src/query/docseqdb.cpp |
|
b/src/query/docseqdb.cpp |
|
... |
|
... |
21 |
using std::list;
|
21 |
using std::list;
|
22 |
|
22 |
|
23 |
#include "docseqdb.h"
|
23 |
#include "docseqdb.h"
|
24 |
#include "rcldb.h"
|
24 |
#include "rcldb.h"
|
25 |
#include "debuglog.h"
|
25 |
#include "debuglog.h"
|
26 |
#include "internfile.h"
|
|
|
27 |
#include "wasatorcl.h"
|
26 |
#include "wasatorcl.h"
|
28 |
|
27 |
|
29 |
DocSequenceDb::DocSequenceDb(RefCntr<Rcl::Query> q, const string &t,
|
28 |
DocSequenceDb::DocSequenceDb(RefCntr<Rcl::Query> q, const string &t,
|
30 |
RefCntr<Rcl::SearchData> sdata)
|
29 |
RefCntr<Rcl::SearchData> sdata)
|
31 |
: DocSequence(t), m_q(q), m_sdata(sdata), m_fsdata(sdata),
|
30 |
: DocSequence(t), m_q(q), m_sdata(sdata), m_fsdata(sdata),
|
|
... |
|
... |
127 |
return m_q->getFirstMatchPage(doc, term);
|
126 |
return m_q->getFirstMatchPage(doc, term);
|
128 |
}
|
127 |
}
|
129 |
return -1;
|
128 |
return -1;
|
130 |
}
|
129 |
}
|
131 |
|
130 |
|
132 |
bool DocSequenceDb::getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc)
|
131 |
Rcl::Db *DocSequenceDb::getDb()
|
133 |
{
|
132 |
{
|
134 |
// Note: no need for setQuery here, we're just passing through a
|
133 |
return m_q.isNotNull() ? m_q->whatDb() : 0;
|
135 |
// query-independant request
|
|
|
136 |
|
|
|
137 |
string udi;
|
|
|
138 |
if (!FileInterner::getEnclosing(doc.url, doc.ipath, pdoc.url, pdoc.ipath,
|
|
|
139 |
udi))
|
|
|
140 |
return false;
|
|
|
141 |
bool dbret = m_q->whatDb()->getDoc(udi, pdoc);
|
|
|
142 |
return dbret && pdoc.pc != -1;
|
|
|
143 |
}
|
134 |
}
|
144 |
|
135 |
|
145 |
list<string> DocSequenceDb::expand(Rcl::Doc &doc)
|
136 |
list<string> DocSequenceDb::expand(Rcl::Doc &doc)
|
146 |
{
|
137 |
{
|
147 |
if (!setQuery())
|
138 |
if (!setQuery())
|