fts-api.c revision a8c5a86d183db25a57bf193c06b41e092ec2e151
/* Copyright (c) 2006-2014 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "hex-binary.h"
#include "mail-index.h"
#include "mail-namespace.h"
#include "mail-storage-private.h"
#include "mail-search.h"
#include "../virtual/virtual-storage.h"
#include "fts-api-private.h"
{
if (!array_is_created(&backends))
}
void fts_backend_unregister(const char *name)
{
const struct fts_backend *const *be;
unsigned int i, count;
for (i = 0; i < count; i++) {
break;
}
}
if (i == count)
if (count == 1)
}
static const struct fts_backend *
fts_backend_class_lookup(const char *backend_name)
{
const struct fts_backend *const *be;
unsigned int i, count;
if (array_is_created(&backends)) {
for (i = 0; i < count; i++) {
return be[i];
}
}
return NULL;
}
{
const struct fts_backend *be;
struct fts_backend *backend;
*error_r = "Unknown backend";
return -1;
}
return -1;
}
return 0;
}
{
}
{
struct fts_index_header hdr;
/* virtual mailboxes themselves don't have any indexes,
so catch this call here */
*last_uid_r = 0;
else
return 0;
}
}
{
}
struct fts_backend_update_context *
{
struct fts_backend_update_context *ctx;
return ctx;
}
{
}
}
{
int ret;
return ret;
}
{
/* make sure we don't reference the backend box anymore */
}
}
{
}
const struct fts_backend_build_key *key)
{
return FALSE;
return TRUE;
}
{
if (ctx->build_key_open) {
}
}
{
}
{
}
{
}
{
}
static void
{
unsigned int i, count;
and no lists have none */
/* create unwanted sequences list from both sources */
/* drop unwanted uids */
/* add uids that are in dest_definite and src_maybe lists */
for (i = 0; i < count; i++) {
}
}
}
{
T_BEGIN {
} T_END;
/* keep only what exists in both lists. the rest is in
maybies or not wanted */
}
const struct mail_search_arg *args)
{
case SEARCH_OR:
case SEARCH_SUB:
case SEARCH_INTHREAD:
return TRUE;
break;
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
case SEARCH_BODY:
case SEARCH_TEXT:
return TRUE;
default:
break;
}
}
return FALSE;
}
const struct mail_search_arg *args)
{
}
const struct fts_score_map *m2)
{
return -1;
return 1;
return 0;
}
struct fts_result *result)
{
return -1;
}
return 0;
}
struct fts_multi_result *result)
{
unsigned int i;
return -1;
struct fts_result, 1);
}
return 0;
}
and_args, box_result) < 0)
return -1;
}
return 0;
}
{
}
{
sizeof(struct fts_index_header),
0, 0);
}
{
struct mail_index_view *view;
const void *data;
bool ret;
} else {
}
return ret;
}
const struct fts_index_header *hdr)
{
struct mail_index_transaction *trans;
return mail_index_transaction_commit(&trans);
}
{
struct fts_index_header hdr;
}
{
struct fts_index_header hdr;
const char *vname;
unsigned int len;
int ret;
vname = "INBOX";
else {
len--;
}
i_error("lucene: Failed to sync mailbox INBOX: %s",
ret = -1;
} else {
}
mailbox_free(&box);
return ret;
}
static const char *indexed_headers[] = {
"From", "To", "Cc", "Bcc", "Subject"
};
bool fts_header_want_indexed(const char *hdr_name)
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(indexed_headers); i++) {
return TRUE;
}
return FALSE;
}
{
struct mailbox_metadata metadata;
return -1;
return 0;
}