|
a/src/rcldb/rclterms.cpp |
|
b/src/rcldb/rclterms.cpp |
|
... |
|
... |
127 |
for (vector<TermMatchEntry>::iterator it = terms.begin();
|
127 |
for (vector<TermMatchEntry>::iterator it = terms.begin();
|
128 |
it != terms.end(); it++)
|
128 |
it != terms.end(); it++)
|
129 |
it->term.insert(0, prefix);
|
129 |
it->term.insert(0, prefix);
|
130 |
}
|
130 |
}
|
131 |
|
131 |
|
|
|
132 |
static const char *tmtptostr(int typ)
|
|
|
133 |
{
|
|
|
134 |
switch (typ) {
|
|
|
135 |
case Db::ET_WILD: return "wildcard";
|
|
|
136 |
case Db::ET_REGEXP: return "regexp";
|
|
|
137 |
case Db::ET_STEM: return "stem";
|
|
|
138 |
case Db::ET_NONE:
|
|
|
139 |
default: return "none";
|
|
|
140 |
}
|
|
|
141 |
}
|
|
|
142 |
|
132 |
// Find all index terms that match an input along different expansion modes:
|
143 |
// Find all index terms that match an input along different expansion modes:
|
133 |
// wildcard, regular expression, or stemming. Depending on flags we perform
|
144 |
// wildcard, regular expression, or stemming. Depending on flags we perform
|
134 |
// case and/or diacritics expansion (this can be the only thing requested).
|
145 |
// case and/or diacritics expansion (this can be the only thing requested).
|
135 |
// If the "field" parameter is set, we return a list of appropriately
|
146 |
// If the "field" parameter is set, we return a list of appropriately
|
136 |
// prefixed terms (which are going to be used to build a Xapian
|
147 |
// prefixed terms (which are going to be used to build a Xapian
|
|
... |
|
... |
155 |
stripped = true;
|
166 |
stripped = true;
|
156 |
#else
|
167 |
#else
|
157 |
stripped = o_index_stripchars;
|
168 |
stripped = o_index_stripchars;
|
158 |
#endif
|
169 |
#endif
|
159 |
|
170 |
|
160 |
LOGDEB(("Db::TermMatch: typ %d diacsens %d casesens %d lang [%s] term [%s] "
|
171 |
LOGDEB(("Db::TermMatch: typ %s diacsens %d casesens %d lang [%s] term [%s] "
|
161 |
"max %d field [%s] stripped %d\n",
|
172 |
"max %d field [%s] stripped %d\n",
|
162 |
matchtyp, diac_sensitive, case_sensitive, lang.c_str(),
|
173 |
tmtptostr(matchtyp), diac_sensitive, case_sensitive, lang.c_str(),
|
163 |
_term.c_str(), max, field.c_str(), stripped));
|
174 |
_term.c_str(), max, field.c_str(), stripped));
|
164 |
|
175 |
|
165 |
// If index is stripped, no case or diac expansion can be needed:
|
176 |
// If index is stripped, no case or diac expansion can be needed:
|
166 |
// for the processing inside this routine, everything looks like
|
177 |
// for the processing inside this routine, everything looks like
|
167 |
// we're all-sensitive: no use of expansion db.
|
178 |
// we're all-sensitive: no use of expansion db.
|
|
... |
|
... |
211 |
// Retrieve additional info and filter against the index itself
|
222 |
// Retrieve additional info and filter against the index itself
|
212 |
for (vector<string>::const_iterator it = exp.begin();
|
223 |
for (vector<string>::const_iterator it = exp.begin();
|
213 |
it != exp.end(); it++) {
|
224 |
it != exp.end(); it++) {
|
214 |
idxTermMatch(ET_NONE, "", *it, res, max, field);
|
225 |
idxTermMatch(ET_NONE, "", *it, res, max, field);
|
215 |
}
|
226 |
}
|
|
|
227 |
// And also expand the original expresionn against the
|
|
|
228 |
// main index: for the common case where the expression
|
|
|
229 |
// had no case/diac expansion (no entry in the exp db if
|
|
|
230 |
// the original term is lowercase and without accents).
|
|
|
231 |
idxTermMatch(typ_sens, lang, term, res, max, field);
|
216 |
} else {
|
232 |
} else {
|
217 |
idxTermMatch(typ_sens, lang, term, res, max, field);
|
233 |
idxTermMatch(typ_sens, lang, term, res, max, field);
|
218 |
}
|
234 |
}
|
219 |
|
235 |
|
220 |
#endif // RCL_INDEX_STRIPCHARS
|
236 |
#endif // RCL_INDEX_STRIPCHARS
|