╭ changed ───────────────╮ │src/event/Discussion.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const evt = @import("../event.zig"); │ │3 +const srch = @import("../search_thread.zig");│ │4 const xit = @import("xit"); │ │5 const rp = xit.repo; │ │6 const hash = xit.hash; │ ╰────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 90 const ids = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, all_id_set_key))); │ │ 91 try ids.put(&evt.orderKeyDesc(record_to_write.created_order, event_id)); │ │ 92 } │ │ 93 + │ │ 94 + // the search index is keyed by creation, not activity: ordering is the │ │ 95 + // list's business, so a comment moving the discussion up leaves it alone │ │ 96 + const search_key = evt.orderKeyDesc(record_to_write.created_order, event_id); │ │ 97 + try srch.update(DB, hash_kind, .discuss, haxy_moment, arena.child_allocator, if (existing_record_maybe) |existing| srch.doc(&search_key, existing) else null, srch.doc(&search_key, record_to_write));│ │ 98 │ │ 99 if (!record_to_write.removed) { │ │100 try active.put(&order_key); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯