I'll dig to find which commit it was that introduced the changes. Karl On Sat, Sep 22, 2018 at 11:28 AM Alexandre Rafalovitch <[email protected]> wrote:
> Do you know which Jira introduced the change? > > Without further details (I am barely familiar with that code part), it > sounds like a regression and possibly even a blocker for the next > version. Unless there is a workaround that is quite non-intuitive. > > Regards, > Alex. > > On 21 September 2018 at 11:43, Karl Wright <[email protected]> wrote: > > I should also mention that Solr Cell makes use of the multipart form's > > separator name. This functionality seems to be unavailable through the > URL. > > We have a number of clients who rely on this. > > > > Karl > > > > > > On Fri, Sep 21, 2018 at 10:15 AM Karl Wright <[email protected]> wrote: > >> > >> Hi all, > >> > >> With the release of 7.4, several things changed inside Solrj. One > >> critical thing that changed was that it now seems to be impossible to > send > >> POST requests with multipart form encoding. This functionality is > critical > >> to ManifoldCF since the metadata it sends to Solr regularly exceeds URL > >> length. Here's a snippet of (modified) code from HttpSolrClient: > >> > >> >>>>>> > >> if(contentWriter != null) { > >> String fullQueryUrl = url + toQueryString(wparams, false); > >> HttpEntityEnclosingRequestBase postOrPut = > SolrRequest.METHOD.POST > >> == request.getMethod() ? > >> new HttpPost(fullQueryUrl) : new HttpPut(fullQueryUrl); > >> System.out.println("Content type is > >> "+contentWriter.getContentType()); > >> postOrPut.addHeader("Content-Type", > >> contentWriter.getContentType()); > >> postOrPut.setEntity(new BasicHttpEntity(){ > >> @Override > >> public boolean isStreaming() { > >> return true; > >> } > >> > >> @Override > >> public void writeTo(OutputStream outstream) throws > IOException { > >> contentWriter.write(outstream); > >> } > >> }); > >> return postOrPut; > >> <<<<<< > >> > >> This takes over all transmissions of POST requests, in practice, and > >> transmits them as application/octet-stream, with metadata on the URL. > >> There's no way to override this; while I can instead used the multipart > >> stuff consistently, when I do so the request to delete a document fails, > >> with this SolrJ stack trace: > >> > >> >>>>>> > >> FATAL 2018-09-21T09:54:58,362 (Document delete thread '4') - Error > tossed: > >> This Should not happen > >> java.lang.RuntimeException: This Should not happen > >> at > >> > org.apache.solr.client.solrj.impl.BinaryRequestWriter.getContentStreams(BinaryRequestWriter.java:67) > >> ~[solr-solrj-7.4.0.jar:7.4.0 9060ac689c270b02143f375de0348b7f626adebc - > >> jpountz - 2018-06-18 16:55:14] > >> at > >> > org.apache.manifoldcf.agents.output.solr.ModifiedHttpSolrClient.createMethod(ModifiedHttpSolrClient.java:148) > >> ~[classes/:?] > >> at > >> > org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:253) > >> ~[solr-solrj-7.4.0.jar:7.4.0 9060ac689c270b02143f375de0348b7f626adebc - > >> jpountz - 2018-06-18 16:55:14] > >> at > >> > org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:244) > >> ~[solr-solrj-7.4.0.jar:7.4.0 9060ac689c270b02143f375de0348b7f626adebc - > >> jpountz - 2018-06-18 16:55:14] > >> at > >> org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:194) > >> ~[solr-solrj-7.4.0.jar:7.4.0 9060ac689c270b02143f375de0348b7f626adebc - > >> jpountz - 2018-06-18 16:55:14] > >> at > >> org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:211) > >> ~[solr-solrj-7.4.0.jar:7.4.0 9060ac689c270b02143f375de0348b7f626adebc - > >> jpountz - 2018-06-18 16:55:14] > >> at > >> > org.apache.manifoldcf.agents.output.solr.HttpPoster$DeleteThread.run(HttpPoster.java:1364) > >> ~[classes/:?] > >> <<<<<< > >> > >> Any ideas? > >> > >> Karl > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
