When flag is set, FTS will not be performed.
fts plugin: handle no_fts flag
No fts will be performed once flag is set.
Original patch from Timo Sirainen <timo.sirainen@dovecot.fi>
unsigned int match_always:1; /* result = 1 always */
unsigned int nonmatch_always:1; /* result = 0 always */
unsigned int fuzzy:1; /* use fuzzy matching for this arg */
+ unsigned int no_fts:1; /* do NOT call FTS */
int result; /* -1 = unknown, 0 = unmatched, 1 = matched */
};
bool and_args = (flags & FTS_LOOKUP_FLAG_AND_ARGS) != 0;
Query *q;
+ if (arg->no_fts)
+ return false;
+
if (arg->match_not && !and_args) {
/* FIXME: we could handle this by doing multiple queries.. */
return false;
bool and_args = (flags & FTS_LOOKUP_FLAG_AND_ARGS) != 0;
Query *q = NULL;
+ if (arg->no_fts)
+ return false;
+
if (arg->match_not) {
/* FIXME: we could handle this by doing multiple queries.. */
return false;
static bool
solr_add_definite_query(string_t *str, struct mail_search_arg *arg)
{
+ if (arg->no_fts)
+ return FALSE;
switch (arg->type) {
case SEARCH_TEXT: {
if (arg->match_not)
static bool
solr_add_definite_query(string_t *str, struct mail_search_arg *arg)
{
+ if (arg->no_fts)
+ return FALSE;
switch (arg->type) {
case SEARCH_TEXT: {
if (arg->match_not)
static bool
solr_add_maybe_query(string_t *str, struct mail_search_arg *arg)
{
+ if (arg->no_fts)
+ return FALSE;
switch (arg->type) {
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
case SEARCH_HEADER_COMPRESS_LWSP:
case SEARCH_BODY:
case SEARCH_TEXT:
- return TRUE;
+ if (!args->no_fts)
+ return TRUE;
+ break;
default:
break;
}
break;
case SEARCH_BODY:
case SEARCH_TEXT:
- return TRUE;
+ if (!args->no_fts)
+ return TRUE;
+ break;
default:
break;
}