]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fixed searching multiple mailboxes
authorx16a0 <m.k-92@gmx.de>
Fri, 15 Jul 2016 07:53:12 +0000 (09:53 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 7 Aug 2016 22:58:36 +0000 (01:58 +0300)
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

index 5d0d3ac3902c842d1e7e8150c3ff3c0a8f32bb33..6fa5f11ca5d4ce79afe235817926007a87f58251 100644 (file)
@@ -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++) {