store: update for new sexp api

And use improved cached_sexp api (automatically handled with
mu-document now)
This commit is contained in:
Dirk-Jan C. Binnema
2022-11-07 18:35:25 +02:00
parent e1dd6f10b1
commit a417b38624
3 changed files with 9 additions and 12 deletions

View File

@ -262,11 +262,10 @@ struct Store::Private {
Result<Store::Id>
Store::Private::update_message_unlocked(Message& msg, Store::Id docid)
{
msg.update_cached_sexp();
return xapian_try_result([&]{
writable_db().replace_document(docid, msg.document().xapian_document());
g_debug("updated message @ %s; docid = %u", msg.path().c_str(), docid);
//g_info("%s", msg.sexp().to_string().c_str());
writable_db().set_metadata(ChangedKey, tstamp_to_string(::time({})));
return Ok(std::move(docid));
});
@ -275,8 +274,6 @@ Store::Private::update_message_unlocked(Message& msg, Store::Id docid)
Result<Store::Id>
Store::Private::update_message_unlocked(Message& msg, const std::string& path_to_replace)
{
msg.update_cached_sexp();
return xapian_try_result([&]{
auto id = writable_db().replace_document(
field_from_id(Field::Id::Path).xapian_term(path_to_replace),