Isabelle Giguere commented on SOLR-7913:
Since Solr 7.1, requestParsers param enableStreamBody allows control over stream.body support, but stream.body still cannot be used with the MLT Qparser. Current behavior insists on looking for a doc id.
Clean patch to allow stream.body im MLT QParser (no trace of SOLR-8604 as previously)
Patch based on revision 61870, tag 7.5.0, latest release
New class org.apache.solr.client.solrj.request.ContentStreamQueryRequest should override SolrRequest.getContentWriter(String) instead of SolrRequest.getContentStreams()
Changes in org.apache.solr.request.json.RequestUtil allow stream.body on an MLT Qparser request, but test TestRemoteStreaming.testNoUrlAccess fails (meaning the test query doesn't fail), so is ignored for now.
There should be a better fix, that would consider MLT QParser, Json requests, and still pass test TestRemoteStreaming.testNoUrlAccess
- Set a contentType on MLT QParser requests with stream.body, and check for that contentType along with "/json" in RequestUtil ?
- Require param 'json' on all Json requests ? Meaning the query at line 178 in TestJsonRequest.doJsonRequest(Client, boolean) would not be allowed
There could be a more streamlined solution, closer to how requestParsers param enableStreamBody is supported elsewhere in the code.