|
a/src/rcldb/rclterms.cpp |
|
b/src/rcldb/rclterms.cpp |
|
... |
|
... |
162 |
return false;
|
162 |
return false;
|
163 |
Xapian::Database xrdb = m_ndb->xrdb;
|
163 |
Xapian::Database xrdb = m_ndb->xrdb;
|
164 |
|
164 |
|
165 |
bool diac_sensitive = (typ_sens & ET_DIACSENS) != 0;
|
165 |
bool diac_sensitive = (typ_sens & ET_DIACSENS) != 0;
|
166 |
bool case_sensitive = (typ_sens & ET_CASESENS) != 0;
|
166 |
bool case_sensitive = (typ_sens & ET_CASESENS) != 0;
|
167 |
|
167 |
// Path elements (used for dir: filtering) are special because
|
168 |
LOGDEB0("Db::TermMatch: typ " << (tmtptostr(matchtyp)) << " diacsens " << (diac_sensitive) << " casesens " << (case_sensitive) << " lang [" << (lang) << "] term [" << (_term) << "] max " << (max) << " field [" << (field) << "] stripped " << (o_index_stripchars) << " init res.size " << (res.entries.size()) << "\n" );
|
168 |
// they are not unaccented or lowercased even if the index is
|
|
|
169 |
// otherwise stripped.
|
|
|
170 |
bool pathelt = (typ_sens & ET_PATHELT) != 0;
|
|
|
171 |
|
|
|
172 |
LOGDEB0("Db::TermMatch: typ " << tmtptostr(matchtyp) << " diacsens " <<
|
|
|
173 |
diac_sensitive << " casesens " << case_sensitive << " pathelt " <<
|
|
|
174 |
pathelt << " lang [" <<
|
|
|
175 |
lang << "] term [" << _term << "] max " << max << " field [" <<
|
|
|
176 |
field << "] stripped " << o_index_stripchars << " init res.size "
|
|
|
177 |
<< res.entries.size() << "\n");
|
169 |
|
178 |
|
170 |
// If index is stripped, no case or diac expansion can be needed:
|
179 |
// If index is stripped, no case or diac expansion can be needed:
|
171 |
// for the processing inside this routine, everything looks like
|
180 |
// for the processing inside this routine, everything looks like
|
172 |
// we're all-sensitive: no use of expansion db.
|
181 |
// we're all-sensitive: no use of expansion db.
|
173 |
// Also, convert input to lowercase and strip its accents.
|
182 |
// Also, convert input to lowercase and strip its accents.
|
174 |
string term = _term;
|
183 |
string term = _term;
|
175 |
if (o_index_stripchars) {
|
184 |
if (o_index_stripchars) {
|
176 |
diac_sensitive = case_sensitive = true;
|
185 |
diac_sensitive = case_sensitive = true;
|
177 |
if (!unacmaybefold(_term, term, "UTF-8", UNACOP_UNACFOLD)) {
|
186 |
if (!pathelt && !unacmaybefold(_term, term, "UTF-8", UNACOP_UNACFOLD)) {
|
178 |
LOGERR("Db::termMatch: unac failed for [" << (_term) << "]\n" );
|
187 |
LOGERR("Db::termMatch: unac failed for [" << _term << "]\n");
|
179 |
return false;
|
188 |
return false;
|
180 |
}
|
189 |
}
|
181 |
}
|
190 |
}
|
182 |
|
191 |
|
183 |
// The case/diac expansion db
|
192 |
// The case/diac expansion db
|