/* Copyright (c) 2011-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "imap-util.h"
#include "mail-namespace.h"
#include "mail-search.h"
#include "mailbox-list-iter.h"
#include "fts-tokenizer.h"
#include "fts-filter.h"
#include "fts-language.h"
#include "fts-storage.h"
#include "fts-search-args.h"
#include "fts-user.h"
#include "doveadm-print.h"
#include "doveadm-mail.h"
#include "doveadm-mailbox-list-iter.h"
#include "doveadm-fts.h"
struct fts_tokenize_cmd_context {
const char *language;
const char *tokens;
};
static int
const struct mailbox_info *info)
{
int ret = 0;
return -1;
}
FTS_LOOKUP_FLAG_AND_ARGS, &result) < 0) {
i_error("fts lookup failed");
ret = -1;
} else {
printf("no results\n");
else T_BEGIN {
} T_END;
} T_END;
}
mailbox_free(&box);
return ret;
}
static int
{
int ret = 0;
ret = -1;
} T_END;
if (doveadm_mailbox_list_iter_deinit(&iter) < 0)
ret = -1;
return ret;
}
static void
const char *const args[])
{
doveadm_mail_help_name("fts lookup");
}
static struct doveadm_mail_cmd_context *
cmd_fts_lookup_alloc(void)
{
return ctx;
}
static int
{
i_error("fts not enabled for INBOX");
return -1;
}
i_fatal("Couldn't expand search args");
mailbox_free(&box);
return 0;
}
static void
const char *const args[])
{
doveadm_mail_help_name("fts expand");
}
static struct doveadm_mail_cmd_context *
cmd_fts_expand_alloc(void)
{
return ctx;
}
static int
{
(struct fts_tokenize_cmd_context *)_ctx;
i_error("fts not enabled for INBOX");
return -1;
}
&lang);
switch (result) {
break;
break;
case FTS_LANGUAGE_RESULT_OK:
break;
i_error("Language detection library initialization failed");
return -1;
default:
i_unreached();
}
} else {
return -1;
}
}
return -1;
}
for (;;) {
if (!final) {
} else {
}
if (ret < 0)
break;
if (ret2 > 0)
else if (ret2 < 0)
}
if (ret == 0) {
if (final)
break;
}
}
return 0;
}
static void
const char *const args[])
{
(struct fts_tokenize_cmd_context *)_ctx;
doveadm_mail_help_name("fts tokenize");
}
static bool
{
(struct fts_tokenize_cmd_context *)_ctx;
switch (c) {
case 'l':
break;
default:
return FALSE;
}
return TRUE;
}
static struct doveadm_mail_cmd_context *
cmd_fts_tokenize_alloc(void)
{
}
static int
struct mail_namespace **ns_r)
{
else {
return -1;
}
}
i_error("fts not enabled for user's namespace %s",
return -1;
}
return 0;
}
static int
{
return -1;
}
if (fts_backend_optimize(backend) < 0) {
i_error("fts optimize failed");
return -1;
}
return 0;
}
static void
const char *const args[])
{
doveadm_mail_help_name("fts optimize");
}
static struct doveadm_mail_cmd_context *
cmd_fts_optimize_alloc(void)
{
return ctx;
}
static int
{
return -1;
}
if (fts_backend_rescan(backend) < 0) {
i_error("fts rescan failed");
return -1;
}
return 0;
}
static void
const char *const args[])
{
doveadm_mail_help_name("fts rescan");
}
static struct doveadm_mail_cmd_context *
cmd_fts_rescan_alloc(void)
{
return ctx;
}
{
.name = "fts lookup",
},
{
.name = "fts expand",
},
{
.name = "fts tokenize",
},
{
.name = "fts optimize",
},
{
.name = "fts rescan",
},
};
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(fts_commands); i++)
}
void doveadm_fts_plugin_deinit(void)
{
}