Mercurial > dovecot > core-2.2
changeset 18578:eff53aa9cb58
fts: When tokenizing a search word, give "search" parameter to all the tokenizers.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 09 May 2015 13:31:14 +0300 |
parents | 162668a63045 |
children | 363397c3701e |
files | src/lib-fts/fts-tokenizer-generic.c src/plugins/fts/fts-user.c |
diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-fts/fts-tokenizer-generic.c Sat May 09 13:30:41 2015 +0300 +++ b/src/lib-fts/fts-tokenizer-generic.c Sat May 09 13:31:14 2015 +0300 @@ -53,6 +53,9 @@ "Invalid algorithm: %s", value); return -1; } + } else if (strcmp(key, "search") == 0) { + /* tokenizing a search string - + makes no difference to us */ } else { *error_r = t_strdup_printf("Unknown setting: %s", key); return -1;
--- a/src/plugins/fts/fts-user.c Sat May 09 13:30:41 2015 +0300 +++ b/src/plugins/fts/fts-user.c Sat May 09 13:31:14 2015 +0300 @@ -148,10 +148,9 @@ set_key = t_strdup_printf("fts_tokenizers_%s", tokenizer_set_name); str = mail_user_plugin_getenv(user, set_key); - /* If the email-address tokenizer is included in the search - tokenizer, add a setting. */ - if (search && strcmp(fts_tokenizer_name(tokenizer_class), - FTS_TOKENIZER_EMAIL_ADDRESS_NAME) == 0) { + /* tell the tokenizers that we're tokenizing a search string + (instead of tokenizing indexed data) */ + if (search) { if (str == NULL) str = "search yes"; else