|
a/src/query/wasatorcl.cpp |
|
b/src/query/wasatorcl.cpp |
|
... |
|
... |
164 |
}
|
164 |
}
|
165 |
continue;
|
165 |
continue;
|
166 |
}
|
166 |
}
|
167 |
|
167 |
|
168 |
// "Regular" processing follows:
|
168 |
// "Regular" processing follows:
|
|
|
169 |
unsigned int mods = (unsigned int)(*it)->m_modifiers;
|
|
|
170 |
nclause = 0;
|
|
|
171 |
|
169 |
switch ((*it)->m_op) {
|
172 |
switch ((*it)->m_op) {
|
170 |
case WasaQuery::OP_NULL:
|
173 |
case WasaQuery::OP_NULL:
|
171 |
case WasaQuery::OP_AND:
|
174 |
case WasaQuery::OP_AND:
|
172 |
default:
|
175 |
default:
|
173 |
reason = "Found bad NULL or AND query type in list";
|
176 |
reason = "Found bad NULL or AND query type in list";
|
|
... |
|
... |
189 |
(*it)->m_fieldspec = "ext";
|
192 |
(*it)->m_fieldspec = "ext";
|
190 |
(*it)->m_modifiers |= WasaQuery::WQM_NOSTEM;
|
193 |
(*it)->m_modifiers |= WasaQuery::WQM_NOSTEM;
|
191 |
}
|
194 |
}
|
192 |
}
|
195 |
}
|
193 |
}
|
196 |
}
|
194 |
|
|
|
195 |
unsigned int mods = (unsigned int)(*it)->m_modifiers;
|
|
|
196 |
|
197 |
|
197 |
// I'm not sure I understand the phrase/near detection
|
198 |
// I'm not sure I understand the phrase/near detection
|
198 |
// thereafter anymore, maybe it would be better to have an
|
199 |
// thereafter anymore, maybe it would be better to have an
|
199 |
// explicit flag. Mods can only be set after a double
|
200 |
// explicit flag. Mods can only be set after a double
|
200 |
// quote.
|
201 |
// quote.
|
|
... |
|
... |
214 |
if (nclause == 0) {
|
215 |
if (nclause == 0) {
|
215 |
reason = "Out of memory";
|
216 |
reason = "Out of memory";
|
216 |
LOGERR(("wasaQueryToRcl: out of memory\n"));
|
217 |
LOGERR(("wasaQueryToRcl: out of memory\n"));
|
217 |
return 0;
|
218 |
return 0;
|
218 |
}
|
219 |
}
|
219 |
if (mods & WasaQuery::WQM_NOSTEM) {
|
|
|
220 |
nclause->addModifier(Rcl::SearchDataClause::SDCM_NOSTEMMING);
|
|
|
221 |
}
|
|
|
222 |
if ((*it)->m_weight != 1.0)
|
|
|
223 |
nclause->setWeight((*it)->m_weight);
|
|
|
224 |
sdata->addClause(nclause);
|
|
|
225 |
}
|
220 |
}
|
226 |
break;
|
221 |
break;
|
227 |
|
222 |
|
228 |
case WasaQuery::OP_EXCL:
|
223 |
case WasaQuery::OP_EXCL:
|
229 |
LOGDEB2(("wasaQueryToRcl: excl clause [%s]:[%s]\n",
|
224 |
LOGDEB2(("wasaQueryToRcl: excl clause [%s]:[%s]\n",
|
|
... |
|
... |
246 |
if (nclause == 0) {
|
241 |
if (nclause == 0) {
|
247 |
reason = "Out of memory";
|
242 |
reason = "Out of memory";
|
248 |
LOGERR(("wasaQueryToRcl: out of memory\n"));
|
243 |
LOGERR(("wasaQueryToRcl: out of memory\n"));
|
249 |
return 0;
|
244 |
return 0;
|
250 |
}
|
245 |
}
|
251 |
if ((*it)->m_modifiers & WasaQuery::WQM_NOSTEM)
|
|
|
252 |
nclause->setModifiers(Rcl::SearchDataClause::SDCM_NOSTEMMING);
|
|
|
253 |
if ((*it)->m_weight != 1.0)
|
|
|
254 |
nclause->setWeight((*it)->m_weight);
|
|
|
255 |
sdata->addClause(nclause);
|
|
|
256 |
break;
|
246 |
break;
|
257 |
|
247 |
|
258 |
case WasaQuery::OP_OR:
|
248 |
case WasaQuery::OP_OR:
|
259 |
LOGDEB2(("wasaQueryToRcl: OR clause [%s]:[%s]\n",
|
249 |
LOGDEB2(("wasaQueryToRcl: OR clause [%s]:[%s]\n",
|
260 |
(*it)->m_fieldspec.c_str(), (*it)->m_value.c_str()));
|
250 |
(*it)->m_fieldspec.c_str(), (*it)->m_value.c_str()));
|
|
... |
|
... |
270 |
if (nclause == 0) {
|
260 |
if (nclause == 0) {
|
271 |
LOGERR(("wasaQueryToRcl: out of memory\n"));
|
261 |
LOGERR(("wasaQueryToRcl: out of memory\n"));
|
272 |
reason = "Out of memory";
|
262 |
reason = "Out of memory";
|
273 |
return 0;
|
263 |
return 0;
|
274 |
}
|
264 |
}
|
275 |
if ((*it)->m_modifiers & WasaQuery::WQM_NOSTEM)
|
|
|
276 |
nclause->setModifiers(Rcl::SearchDataClause::SDCM_NOSTEMMING);
|
|
|
277 |
sdata->addClause(nclause);
|
|
|
278 |
}
|
265 |
}
|
|
|
266 |
|
|
|
267 |
if (mods & WasaQuery::WQM_NOSTEM)
|
|
|
268 |
nclause->addModifier(Rcl::SearchDataClause::SDCM_NOSTEMMING);
|
|
|
269 |
if (mods & WasaQuery::WQM_DIACSENS)
|
|
|
270 |
nclause->addModifier(Rcl::SearchDataClause::SDCM_DIACSENS);
|
|
|
271 |
if (mods & WasaQuery::WQM_CASESENS)
|
|
|
272 |
nclause->addModifier(Rcl::SearchDataClause::SDCM_CASESENS);
|
|
|
273 |
if ((*it)->m_weight != 1.0)
|
|
|
274 |
nclause->setWeight((*it)->m_weight);
|
|
|
275 |
sdata->addClause(nclause);
|
279 |
}
|
276 |
}
|
280 |
|
277 |
|
281 |
return sdata;
|
278 |
return sdata;
|
282 |
}
|
279 |
}
|
283 |
|
280 |
|