[Yazlist] Yaz compatibility with solr >= 5.1

Marios Bartzokas mbartzokas at atypon.com
Wed Jul 15 17:09:42 UTC 2015


Hi,

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
header;
Content-type: text/xml

By
1) googling the issue and having found
http://lucene.472066.n3.nabble.com/Bad-contentType-for-search-handler-text-xml-charset-UTF-8-td4200314.html
2) looking in the solr source code

we thought we should try using application/json as the Content-type in the
request headers.

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
succeeded.

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,
Marios
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.indexdata.dk/pipermail/yazlist/attachments/20150715/6983d826/attachment.html>


More information about the Yazlist mailing list