Skip to content

Commit

Permalink
fts: Fix search query generation when tokens are filtered out.
Browse files Browse the repository at this point in the history
For example with English stopwords when searching "foo and bar" it should
be equilevant to "foo bar", since "and" is filtered out.
  • Loading branch information
sirainen authored and GitLab committed Jan 25, 2017
1 parent ba706bd commit 513b045
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/fts/fts-search-args.c
Expand Up @@ -81,6 +81,11 @@ fts_backend_dovecot_expand_tokens(struct fts_filter *filter,
} else if (ret < 0) {
*error_r = t_strdup_printf("Couldn't filter search token: %s", error);
return -1;
} else {
/* The filter dropped the token, which means it was
never even indexed. Ignore this word entirely in the
search query. */
return 0;
}
}
array_sort(&tokens, i_strcmp_p);
Expand Down

0 comments on commit 513b045

Please sign in to comment.