};
ARRAY_DEFINE_TYPE(fts_score_map, struct fts_score_map);
+/* the structure is meant to be implemented by plugins that want to carry
+ some state over from a call to next ones within an fts_search_context
+ session.
+
+ The pointer to this structure is initially granted to be NULL and it
+ remains such unless the plugin itself activates it.
+
+ Any memory management for the pointer and its contents is expected to
+ be performed by the plugin itself, possibly but not necessarily using
+ the result pool propagated to plugin call by struct fts_result.pool and
+ struct fts_multi_result.pool. */
+
+struct fts_search_state;
+
struct fts_result {
+ pool_t pool;
+ struct fts_search_state *search_state;
+
struct mailbox *box;
ARRAY_TYPE(seq_range) definite_uids;
struct fts_multi_result {
pool_t pool;
+ struct fts_search_state *search_state;
+
/* box=NULL-terminated array of mailboxes and matching UIDs,
all allocated from the given pool. */
struct fts_result *box_results;
struct fts_result result;
i_zero(&result);
+ result.search_state = fctx->search_state;
+ result.pool = fctx->result_pool;
p_array_init(&result.definite_uids, fctx->result_pool, 32);
p_array_init(&result.maybe_uids, fctx->result_pool, 32);
p_array_init(&result.scores, fctx->result_pool, 32);
&result) < 0)
return -1;
+ fctx->search_state = result.search_state;
level = array_append_space(&fctx->levels);
level->args_matches = buffer_create_dynamic(fctx->result_pool, 16);
fts_search_serialize(level->args_matches, args);
array_sort(&mailboxes_arr, mailbox_cmp_fts_backend);
i_zero(&result);
+ result.search_state = fctx->search_state;
result.pool = fctx->result_pool;
level = array_append_space(&fctx->levels);
if (multi_add_lookup_result(fctx, level, args, &result) < 0)
return -1;
}
+ fctx->search_state = result.search_state;
return 0;
}
struct fts_scores *scores;
struct fts_indexer_context *indexer_ctx;
+ struct fts_search_state *search_state;
bool virtual_mailbox:1;
bool fts_lookup_success:1;