store::for_each_term: use field-id

We were trying to convert a field (string) to a xapian prefix back to a
field (enum). That's unnecessarily complicated and worse, step 2 won't work.
This commit is contained in:
Dirk-Jan C. Binnema
2022-03-14 09:38:59 +02:00
parent 0368a48149
commit 056fecd6aa
3 changed files with 5 additions and 17 deletions

View File

@ -200,7 +200,7 @@ Parser::Private::process_regex(const std::string& field_str,
const auto field{message_field(*id_opt)};
const auto prefix{field.xapian_term()};
std::vector<std::string> terms;
store_.for_each_term(prefix, [&](auto&& str) {
store_.for_each_term(field.id, [&](auto&& str) {
if (std::regex_search(str.c_str() + 1, rx)) // avoid copy
terms.emplace_back(str);
return true;