|
a/src/query/wasatorcl.cpp |
|
b/src/query/wasatorcl.cpp |
|
... |
|
... |
193 |
|
193 |
|
194 |
if (!stringicmp("dir", (*it)->m_fieldspec)) {
|
194 |
if (!stringicmp("dir", (*it)->m_fieldspec)) {
|
195 |
// dir filtering special case
|
195 |
// dir filtering special case
|
196 |
nclause = new Rcl::SearchDataClausePath((*it)->m_value,
|
196 |
nclause = new Rcl::SearchDataClausePath((*it)->m_value,
|
197 |
(*it)->m_exclude);
|
197 |
(*it)->m_exclude);
|
198 |
} else if ((*it)->m_exclude) {
|
198 |
} else {
|
199 |
if (wasa->m_op != WasaQuery::OP_AND) {
|
199 |
if ((*it)->m_exclude && wasa->m_op != WasaQuery::OP_AND) {
|
200 |
LOGERR(("wasaQueryToRcl: excl clause inside OR list!\n"));
|
200 |
LOGERR(("wasaQueryToRcl: excl clause inside OR list!\n"));
|
201 |
continue;
|
201 |
continue;
|
202 |
}
|
202 |
}
|
203 |
// Note: have to add dquotes which will be translated to
|
|
|
204 |
// phrase if there are several words in there. Not pretty
|
|
|
205 |
// but should work. If there is actually a single
|
|
|
206 |
// word, it will not be taken as a phrase, and
|
|
|
207 |
// stem-expansion will work normally
|
|
|
208 |
// Have to do this because searchdata has nothing like and_not
|
|
|
209 |
nclause = new Rcl::SearchDataClauseSimple(Rcl::SCLT_EXCL,
|
|
|
210 |
string("\"") +
|
|
|
211 |
(*it)->m_value + "\"",
|
|
|
212 |
(*it)->m_fieldspec);
|
|
|
213 |
} else {
|
|
|
214 |
// I'm not sure I understand the phrase/near detection
|
203 |
// I'm not sure I understand the phrase/near detection
|
215 |
// thereafter anymore, maybe it would be better to have an
|
204 |
// thereafter anymore, maybe it would be better to have an
|
216 |
// explicit flag. Mods can only be set after a double
|
205 |
// explicit flag. Mods can only be set after a double
|
217 |
// quote.
|
206 |
// quote.
|
218 |
if (TextSplit::hasVisibleWhite((*it)->m_value) || mods) {
|
207 |
if (TextSplit::hasVisibleWhite((*it)->m_value) || mods) {
|
219 |
Rcl::SClType tp = Rcl::SCLT_PHRASE;
|
208 |
|
220 |
if (mods & WasaQuery::WQM_PROX) {
|
209 |
Rcl::SClType tp = (mods & WasaQuery::WQM_PROX) ?
|
221 |
tp = Rcl::SCLT_NEAR;
|
210 |
Rcl::SCLT_NEAR :
|
222 |
}
|
211 |
Rcl::SCLT_PHRASE;
|
223 |
nclause = new Rcl::SearchDataClauseDist(tp, (*it)->m_value,
|
212 |
nclause = new Rcl::SearchDataClauseDist(tp, (*it)->m_value,
|
224 |
(*it)->m_slack,
|
213 |
(*it)->m_slack,
|
225 |
(*it)->m_fieldspec);
|
214 |
(*it)->m_fieldspec);
|
226 |
} else {
|
215 |
} else {
|
227 |
nclause = new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND,
|
216 |
Rcl::SClType tp = (*it)->m_exclude ?
|
228 |
(*it)->m_value,
|
217 |
Rcl::SCLT_OR:
|
|
|
218 |
Rcl::SCLT_AND;
|
|
|
219 |
nclause =
|
|
|
220 |
new Rcl::SearchDataClauseSimple(tp, (*it)->m_value,
|
229 |
(*it)->m_fieldspec);
|
221 |
(*it)->m_fieldspec);
|
230 |
}
|
222 |
}
|
|
|
223 |
nclause->setexclude((*it)->m_exclude);
|
231 |
}
|
224 |
}
|
232 |
|
225 |
|
233 |
if (nclause == 0) {
|
226 |
if (nclause == 0) {
|
234 |
reason = "Out of memory";
|
227 |
reason = "Out of memory";
|
235 |
LOGERR(("wasaQueryToRcl: out of memory\n"));
|
228 |
LOGERR(("wasaQueryToRcl: out of memory\n"));
|