From: Simon Frankenberger Date: Thu, 9 Nov 2017 06:08:24 +0000 (+0100) Subject: fts-solr: Explicitly ask for XML responses X-Git-Tag: 2.3.0.rc1~471 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f987ef0632fc7be03e7f26dcd99695a6936c284e;p=thirdparty%2Fdovecot%2Fcore.git fts-solr: Explicitly ask for XML responses With recent solr versions (7.0+) the default response writer changed from XML to JSON. This commit sets the "wt" query parameter for all requests, so that the right response type is written. --- diff --git a/src/plugins/fts-solr/fts-backend-solr.c b/src/plugins/fts-solr/fts-backend-solr.c index 46d1974dd0..372ae6dfd1 100644 --- a/src/plugins/fts-solr/fts-backend-solr.c +++ b/src/plugins/fts-solr/fts-backend-solr.c @@ -224,7 +224,7 @@ get_last_uid_fallback(struct fts_backend *_backend, struct mailbox *box, int ret = 0; str = t_str_new(256); - str_append(str, "fl=uid&rows=1&sort=uid+desc&q="); + str_append(str, "wt=xml&fl=uid&rows=1&sort=uid+desc&q="); if (fts_mailbox_get_guid(box, &box_guid) < 0) return -1; @@ -836,7 +836,7 @@ fts_backend_solr_lookup(struct fts_backend *_backend, struct mailbox *box, mailbox_get_open_status(box, STATUS_UIDNEXT, &status); str = t_str_new(256); - str_printfa(str, "fl=uid,score&rows=%u&sort=uid+asc&q=%%7b!lucene+q.op%%3dAND%%7d", + str_printfa(str, "wt=xml&fl=uid,score&rows=%u&sort=uid+asc&q=%%7b!lucene+q.op%%3dAND%%7d", status.uidnext); prefix_len = str_len(str); @@ -946,7 +946,7 @@ fts_backend_solr_lookup_multi(struct fts_backend *backend, string_t *str; str = t_str_new(256); - str_printfa(str, "fl=box,uid,score&rows=%u&sort=box+asc,uid+asc&q=%%7b!lucene+q.op%%3dAND%%7d", + str_printfa(str, "wt=xml&fl=box,uid,score&rows=%u&sort=box+asc,uid+asc&q=%%7b!lucene+q.op%%3dAND%%7d", SOLR_MAX_MULTI_ROWS); if (solr_add_definite_query_args(str, args, and_args)) {