[Yazlist] Yaz compatibility with solr >= 5.1
wosch at freebsd.org
Thu Jul 16 07:48:49 UTC 2015
On 15 July 2015 at 19:09, Marios Bartzokas <mbartzokas at atypon.com> wrote:
> We use metaproxy 1.8.10 with yaz 5.14.3 making requests to a solr index.
> And we recently switched from solr 4.10.4 to 5.2.1.
> This caused the requests from metaproxy to solr to fail with solr giving us
> the following error:
> HTTP 400 Bad Request - Bad contentType for search handler :text/xml
> Looking in metaproxy logs I see that a request to solr has the following
> Content-type: text/xml
> 1) googling the issue and having found
> 2) looking in the solr source code
it turns out that solr has problems with the standard content type "text/xml"
> we thought we should try using application/json as the Content-type in the
> request headers.
please try instead "application/xml"
> After many failed attempts to achieve that by using the metaproxy
> http-rewrite filter, we changed the source code of yaz-5.14.3, file solr.c,
> function yaz_solr_encode_request,
> z_HTTP_header_add_content_type(encode, &hreq->headers,
> "text/xml;application/json", charset);
> to include the application/json in addition to text/xml.
> This successfully changed the Content-Type and the request to solr now
> We wanted 1) to report that and 2) to ask whether you think it is a good
> solution or you would suggest another approach.
> Best Regards,
Wolfram Schneider <wosch at FreeBSD.org> http://wolfram.schneider.org
More information about the Yazlist