Lines Matching defs:fctx

133 			       struct fts_search_context *fctx)
137 i_assert(!fts_backend_is_updating(fctx->backend));
139 ret = fts_indexer_init(fctx->backend, ctx->transaction->box,
140 &fctx->indexer_ctx);
146 fts_search_lookup(fctx);
208 struct fts_search_context *fctx;
216 fctx = i_new(struct fts_search_context, 1);
217 fctx->box = t->box;
218 fctx->backend = flist->backend;
219 fctx->t = t;
220 fctx->args = args;
221 fctx->result_pool = pool_alloconly_create("fts results", 1024*64);
222 fctx->orig_matches = buffer_create_dynamic(default_pool, 64);
223 fctx->virtual_mailbox = t->box->virtual_vfuncs != NULL;
224 fctx->enforced =
227 i_array_init(&fctx->levels, 8);
228 fctx->scores = i_new(struct fts_scores, 1);
229 fctx->scores->refcount = 1;
230 i_array_init(&fctx->scores->score_map, 64);
231 MODULE_CONTEXT_SET(ctx, fts_storage_module, fctx);
238 fctx->flags |= FTS_LOOKUP_FLAG_NO_AUTO_FUZZY;
243 ft->scores = fctx->scores;
246 if (fctx->enforced || fts_want_build_args(args->args))
247 fts_try_build_init(ctx, fctx);
249 fts_search_lookup(fctx);
255 struct fts_search_context *fctx = FTS_CONTEXT_REQUIRE(ctx);
258 ret = fts_indexer_more(fctx->indexer_ctx);
264 if (fts_indexer_deinit(&fctx->indexer_ctx) < 0)
267 fts_search_lookup(fctx);
276 fctx->indexing_timed_out =
277 mailbox_get_last_mail_error(fctx->box) == MAIL_ERROR_INUSE;
287 struct fts_search_context *fctx = FTS_CONTEXT(ctx);
290 if (fctx == NULL && ft->failed) {
296 if (fctx != NULL && fctx->indexer_ctx != NULL) {
302 if (fctx->indexing_timed_out) {
307 if (fctx != NULL && !fctx->fts_lookup_success && fctx->enforced)
318 struct fts_search_context *fctx = FTS_CONTEXT_REQUIRE(ctx);
321 level = array_idx(&fctx->levels, *idx);
342 struct fts_search_context *fctx = FTS_CONTEXT(ctx);
345 if (fctx == NULL || !fctx->fts_lookup_success) {
347 if (fctx != NULL && fctx->indexing_timed_out)
353 fts_search_deserialize(ctx->args->args, fctx->orig_matches);
358 if (ctx->seq >= fctx->first_unindexed_seq) {
373 struct fts_search_context *fctx = FTS_CONTEXT(ctx);
376 if (fctx != NULL) {
377 if (fctx->indexer_ctx != NULL) {
378 if (fts_indexer_deinit(&fctx->indexer_ctx) < 0)
381 if (fctx->indexing_timed_out)
383 if (!fctx->fts_lookup_success && fctx->enforced) {
390 buffer_free(&fctx->orig_matches);
391 array_free(&fctx->levels);
392 pool_unref(&fctx->result_pool);
393 fts_scores_unref(&fctx->scores);
394 i_free(fctx);