From 0b0d9e641f1003f35c18ae803664d8369321895c Mon Sep 17 00:00:00 2001 From: x16a0 Date: Fri, 15 Jul 2016 09:53:12 +0200 Subject: [PATCH] Fixed searching multiple mailboxes When searching multiple mailboxes, a condition to search these mailboxes is added to the query string. However, this condition has to be separated from the preceding condition by a space (a '+' in this case, as it's encoded); otherwise, Solr considers it to be part of the previous condition, in which case it will fail to parse it properly. Therefore, this patch adds that one missing character so it works again. --- src/plugins/fts-solr/fts-backend-solr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/fts-solr/fts-backend-solr.c b/src/plugins/fts-solr/fts-backend-solr.c index 329dcc7aab..d0c85d3cdb 100644 --- a/src/plugins/fts-solr/fts-backend-solr.c +++ b/src/plugins/fts-solr/fts-backend-solr.c @@ -875,7 +875,7 @@ solr_search_multi(struct fts_backend *_backend, string_t *str, for (i = 0; boxes[i] != NULL; i++) ; search_all_mailboxes = i > SOLR_QUERY_MAX_MAILBOX_COUNT; if (!search_all_mailboxes) - str_append(str, "%2B("); + str_append(str, "+%2B("); len = str_len(str); for (i = 0; boxes[i] != NULL; i++) {