fts-search.c revision efe78d3ba24fc866af1c79b9223dc0809ba26cad
/* Copyright (c) 2006-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "seq-range-array.h"
#include "mail-search.h"
#include "fts-api-private.h"
#include "fts-search-args.h"
#include "fts-search-serialize.h"
#include "fts-storage.h"
static void
{
unsigned int i, count;
if (!array_is_created(seq_range))
for (i = 0; i < count; i++) {
continue;
if (seq1 != 0)
}
}
struct mail_search_arg *args,
bool and_args)
{
(and_args ? FTS_LOOKUP_FLAG_AND_ARGS : 0);
struct fts_search_level *level;
struct fts_result result;
&result) < 0)
return -1;
return 0;
}
static void
{
const struct fts_score_map *scores;
unsigned int i, count;
struct fts_score_map *score;
for (i = 0; i < count; i++)
&backend_uids, &vuids_arr);
for (i = 0; i < count; i++) {
}
}
static int
{
return -1;
return 1;
return 0;
}
static int
struct fts_search_level *level,
struct mail_search_arg *args,
struct fts_multi_result *result)
{
unsigned int i;
if (orig_size > 0) {
i_panic("incompatible fts backends for namespaces");
}
array_clear(&vuids);
}
array_clear(&vuids);
}
}
return 0;
}
struct mail_search_arg *args,
bool and_args)
{
(and_args ? FTS_LOOKUP_FLAG_AND_ARGS : 0);
struct fts_backend *backend;
struct fts_search_level *level;
struct fts_multi_result result;
unsigned int i, j, mailbox_count;
&mailboxes_arr, TRUE);
for (i = 0; i < mailbox_count; i = j) {
for (j = i + 1; j < mailbox_count; j++) {
break;
}
array_idx(&tmp_mailboxes, 0),
return -1;
return -1;
}
return 0;
}
struct mail_search_arg *args,
bool and_args)
{
int ret;
T_BEGIN {
} T_END;
if (ret < 0)
return -1;
continue;
return -1;
}
return 0;
}
static void
{
struct fts_score_map *dest_map;
const struct fts_score_map *src_map;
/* arg_scores are summed to current scores. we could drop UIDs that
don't exist in both, but that's just extra work so don't bother */
desti++;
srci++;
else {
}
}
}
static void
{
/* add any missing UIDs to current scores. if any existing UIDs have
lower scores than in arg_scores, increase them. */
if (src2i == src2_count ||
srci++;
src2i++;
} else {
else
}
}
}
static void
{
const struct fts_search_level *level;
/*
The (simplified) args can look like:
A and B and (C or D) and (E or F) and ...
A or B or (C and D) or (E and F) or ...
The A op B part's scores are in level->scores. The child args'
scores are in the sub levels' scores.
*/
continue;
*idx += 1;
&arg_scores);
if (and_args)
else
}
}
{
unsigned int idx = 0;
}
{
return;
return;
return;
}
}
}