|
a/src/query/docseqdb.cpp |
|
b/src/query/docseqdb.cpp |
|
... |
|
... |
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 "wasatorcl.h"
|
26 |
#include "wasatorcl.h"
|
27 |
|
27 |
|
28 |
DocSequenceDb::DocSequenceDb(RefCntr<Rcl::Query> q, const string &t,
|
28 |
DocSequenceDb::DocSequenceDb(STD_SHARED_PTR<Rcl::Query> q, const string &t,
|
29 |
RefCntr<Rcl::SearchData> sdata)
|
29 |
STD_SHARED_PTR<Rcl::SearchData> sdata)
|
30 |
: DocSequence(t), m_q(q), m_sdata(sdata), m_fsdata(sdata),
|
30 |
: DocSequence(t), m_q(q), m_sdata(sdata), m_fsdata(sdata),
|
31 |
m_rescnt(-1),
|
31 |
m_rescnt(-1),
|
32 |
m_queryBuildAbstract(true),
|
32 |
m_queryBuildAbstract(true),
|
33 |
m_queryReplaceAbstract(false),
|
33 |
m_queryReplaceAbstract(false),
|
34 |
m_isFiltered(false),
|
34 |
m_isFiltered(false),
|
|
... |
|
... |
129 |
return -1;
|
129 |
return -1;
|
130 |
}
|
130 |
}
|
131 |
|
131 |
|
132 |
Rcl::Db *DocSequenceDb::getDb()
|
132 |
Rcl::Db *DocSequenceDb::getDb()
|
133 |
{
|
133 |
{
|
134 |
return m_q.isNotNull() ? m_q->whatDb() : 0;
|
134 |
return m_q ? m_q->whatDb() : 0;
|
135 |
}
|
135 |
}
|
136 |
|
136 |
|
137 |
list<string> DocSequenceDb::expand(Rcl::Doc &doc)
|
137 |
list<string> DocSequenceDb::expand(Rcl::Doc &doc)
|
138 |
{
|
138 |
{
|
139 |
PTMutexLocker locker(o_dblock);
|
139 |
PTMutexLocker locker(o_dblock);
|
|
... |
|
... |
160 |
{
|
160 |
{
|
161 |
LOGDEB(("DocSequenceDb::setFiltSpec\n"));
|
161 |
LOGDEB(("DocSequenceDb::setFiltSpec\n"));
|
162 |
PTMutexLocker locker(o_dblock);
|
162 |
PTMutexLocker locker(o_dblock);
|
163 |
if (fs.isNotNull()) {
|
163 |
if (fs.isNotNull()) {
|
164 |
// We build a search spec by adding a filtering layer to the base one.
|
164 |
// We build a search spec by adding a filtering layer to the base one.
|
165 |
m_fsdata = RefCntr<Rcl::SearchData>(
|
165 |
m_fsdata = STD_SHARED_PTR<Rcl::SearchData>(
|
166 |
new Rcl::SearchData(Rcl::SCLT_AND, m_sdata->getStemLang()));
|
166 |
new Rcl::SearchData(Rcl::SCLT_AND, m_sdata->getStemLang()));
|
167 |
Rcl::SearchDataClauseSub *cl =
|
167 |
Rcl::SearchDataClauseSub *cl =
|
168 |
new Rcl::SearchDataClauseSub(m_sdata);
|
168 |
new Rcl::SearchDataClauseSub(m_sdata);
|
169 |
m_fsdata->addClause(cl);
|
169 |
m_fsdata->addClause(cl);
|
170 |
|
170 |
|
|
... |
|
... |
173 |
case DocSeqFiltSpec::DSFS_MIMETYPE:
|
173 |
case DocSeqFiltSpec::DSFS_MIMETYPE:
|
174 |
m_fsdata->addFiletype(fs.values[i]);
|
174 |
m_fsdata->addFiletype(fs.values[i]);
|
175 |
break;
|
175 |
break;
|
176 |
case DocSeqFiltSpec::DSFS_QLANG:
|
176 |
case DocSeqFiltSpec::DSFS_QLANG:
|
177 |
{
|
177 |
{
|
178 |
if (m_q.isNull())
|
178 |
if (!m_q)
|
179 |
break;
|
179 |
break;
|
180 |
|
180 |
|
181 |
string reason;
|
181 |
string reason;
|
182 |
Rcl::SearchData *sd =
|
182 |
Rcl::SearchData *sd =
|
183 |
wasaStringToRcl(m_q->whatDb()->getConf(),
|
183 |
wasaStringToRcl(m_q->whatDb()->getConf(),
|
184 |
m_sdata->getStemLang(),
|
184 |
m_sdata->getStemLang(),
|
185 |
fs.values[i], reason);
|
185 |
fs.values[i], reason);
|
186 |
if (sd) {
|
186 |
if (sd) {
|
187 |
Rcl::SearchDataClauseSub *cl1 =
|
187 |
Rcl::SearchDataClauseSub *cl1 =
|
188 |
new Rcl::SearchDataClauseSub(
|
188 |
new Rcl::SearchDataClauseSub(
|
189 |
RefCntr<Rcl::SearchData>(sd));
|
189 |
STD_SHARED_PTR<Rcl::SearchData>(sd));
|
190 |
m_fsdata->addClause(cl1);
|
190 |
m_fsdata->addClause(cl1);
|
191 |
}
|
191 |
}
|
192 |
}
|
192 |
}
|
193 |
break;
|
193 |
break;
|
194 |
default:
|
194 |
default:
|