dovecot-1.2: fts-solr: In filter queries use "+" prefixes to req...

dovecot at dovecot.org dovecot at dovecot.org
Sun Nov 30 16:29:21 EET 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/5cc1c4f3d38b
changeset: 8505:5cc1c4f3d38b
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 30 15:44:19 2008 +0200
description:
fts-solr: In filter queries use "+" prefixes to require all the parameters to match.

diffstat:

1 file changed, 5 insertions(+), 5 deletions(-)
src/plugins/fts-solr/fts-backend-solr.c |   10 +++++-----

diffs (39 lines):

diff -r 2297a352dfd3 -r 5cc1c4f3d38b src/plugins/fts-solr/fts-backend-solr.c
--- a/src/plugins/fts-solr/fts-backend-solr.c	Sun Nov 30 15:04:29 2008 +0200
+++ b/src/plugins/fts-solr/fts-backend-solr.c	Sun Nov 30 15:44:19 2008 +0200
@@ -183,7 +183,7 @@ solr_add_ns_query(string_t *str, struct 
 	if (ns == backend->default_ns || *ns->prefix == '\0')
 		str_append(str, " -ns:[* TO *]");
 	else {
-		str_append(str, " ns:");
+		str_append(str, " %2Bns:");
 		solr_quote(str, ns->prefix);
 	}
 }
@@ -376,9 +376,9 @@ fts_backend_solr_filter_mailboxes(struct
 		str_append_c(fq, '(');
 		for (i = 0; i < inc_count; i++) {
 			if (i != 0)
-				str_append(fq, " OR ");
+				str_append(fq, " OR %2B");
 			str_append_c(fq, '(');
-			str_append(fq, "box:");
+			str_append(fq, "%2Bbox:");
 			solr_add_pattern(fq, &includes[i]);
 			solr_add_ns_query(fq, _backend, includes[i].ns);
 			str_append_c(fq, ')');
@@ -706,12 +706,12 @@ static int fts_backend_solr_lookup(struc
 
 	/* use a separate filter query for selecting the mailbox. it shouldn't
 	   affect the score and there could be some caching benefits too. */
-	str_append(str, "&fq=user:");
+	str_append(str, "&fq=%2Buser:");
 	solr_quote_http(str, box->storage->ns->user->username);
 	if (virtual)
 		fts_backend_solr_filter_mailboxes(ctx->backend, str, box);
 	else {
-		str_printfa(str, "+uidv:%u+box:", status.uidvalidity);
+		str_printfa(str, "+%%2Buidv:%u+%%2Bbox:", status.uidvalidity);
 		solr_quote_http(str, box->name);
 		solr_add_ns_query_http(str, ctx->backend, box->storage->ns);
 	}


More information about the dovecot-cvs mailing list