store: add 'add_document' optimization, use it
*Usually* we need Xapian's replace_document() API, but when we know a document (message) is completely new, we can use the faster add_document(). That is the case with the initial (re)indexing, when start with an empty database. Also a few smaller cleanups.
This commit is contained in:
@ -202,7 +202,7 @@ goto * instructions[pOp->opcode];
|
||||
g_assert_cmpuint(store->size(),==, 1);
|
||||
|
||||
/* ensure 'update' dtrt, i.e., nothing. */
|
||||
const auto docid2 = store->update_message(*message, *docid);
|
||||
const auto docid2 = store->add_message(*message, *docid);
|
||||
assert_valid_result(docid2);
|
||||
g_assert_cmpuint(store->size(),==, 1);
|
||||
g_assert_cmpuint(*docid,==,*docid2);
|
||||
|
||||
Reference in New Issue
Block a user