diff src/plugins/fts-solr/fts-backend-solr.c @ 8505:5cc1c4f3d38b HEAD

fts-solr: In filter queries use "+" prefixes to require all the parameters to match.
author Timo Sirainen <tss@iki.fi>
date Sun, 30 Nov 2008 15:44:19 +0200
parents 3efcdc45d111
children f456043e10d3
line wrap: on
line diff
--- 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 @@
 	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 @@
 		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 @@
 
 	/* 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);
 	}