dovecot-2.2: fts: If backend has FTS_BACKEND_FLAG_TOKENIZED_INPU...

dovecot at dovecot.org dovecot at dovecot.org
Tue Apr 21 18:31:15 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/3f24c8cab32d
changeset: 18444:3f24c8cab32d
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Apr 21 21:28:41 2015 +0300
description:
fts: If backend has FTS_BACKEND_FLAG_TOKENIZED_INPUT set, index also the header name.
We were sending the hdr_name to the backend without tokenizing it or
filtering it, so the backend couldn't have done anything useful about it.

diffstat:

 src/plugins/fts/fts-build-mail.c |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r 5b8959b2ff5e -r 3f24c8cab32d src/plugins/fts/fts-build-mail.c
--- a/src/plugins/fts/fts-build-mail.c	Tue Apr 21 20:59:48 2015 +0300
+++ b/src/plugins/fts/fts-build-mail.c	Tue Apr 21 21:28:41 2015 +0300
@@ -171,6 +171,16 @@
 
 		(void)fts_build_data(ctx, str_data(str), str_len(str), TRUE);
 	} T_END;
+
+	if ((ctx->update_ctx->backend->flags &
+	     FTS_BACKEND_FLAG_TOKENIZED_INPUT) != 0) {
+		/* index the header name itself */
+		key.hdr_name = "";
+		if (fts_backend_update_set_build_key(ctx->update_ctx, &key)) {
+			(void)fts_build_data(ctx, (const void *)hdr->name,
+					     strlen(hdr->name), TRUE);
+		}
+	}
 }
 
 static bool


More information about the dovecot-cvs mailing list