changeset 19493:27ee6a472555

fts: When indexing header names with lib-fts, add them using "data" language.
author Timo Sirainen <tss@iki.fi>
date Tue, 08 Dec 2015 15:47:28 +0200
parents 8f04a0ce1c76
children 63706ee7f49e
files src/plugins/fts/fts-build-mail.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/fts/fts-build-mail.c	Tue Dec 08 13:28:01 2015 +0200
+++ b/src/plugins/fts/fts-build-mail.c	Tue Dec 08 15:47:28 2015 +0200
@@ -213,13 +213,18 @@
 
 	if ((ctx->update_ctx->backend->flags &
 	     FTS_BACKEND_FLAG_TOKENIZED_INPUT) != 0) {
-		/* index the header name itself */
+		/* index the header name itself using data-language. */
+		struct fts_user_language *prev_lang = ctx->cur_user_lang;
+
+		fts_mail_build_ctx_set_lang(ctx,
+			fts_user_get_data_lang(ctx->update_ctx->backend->ns->user));
 		key.hdr_name = "";
 		if (fts_backend_update_set_build_key(ctx->update_ctx, &key)) {
 			if (fts_build_data(ctx, (const void *)hdr->name,
 					   strlen(hdr->name), TRUE) < 0)
 				ret = -1;
 		}
+		fts_mail_build_ctx_set_lang(ctx, prev_lang);
 	}
 	return ret;
 }