Affects Version/s: 6.6.4, 8.4, 8.6.3, 8.7
Fix Version/s: None
Component/s: contrib - Solr Cell (Tika extraction)
(Note: I asked about this in the IRC channel as prompted, but didn't get a response.)
When uploading particular documents to /update/extract, you get different (wrong) results if you are using multipart file upload compared to the basic encoded upload, even though both methods are shown on the documentation page (https://lucene.apache.org/solr/guide/8_7/uploading-data-with-solr-cell-using-apache-tika.html).
The first example in the documentation page uses a multipart POST with a field called 'myfile' set to the file content. Some later examples use a standard POST with the raw data provided.
Here are these two approaches in the commands I used with my example file (I have replaced the URL, username, password, and collection name for my Solr, which isn't publicly available):
The example file is a ~10MB PowerPoint with a few sentences of English text in it (and some pictures).
The nonmultipart-result.txt file is 9,871 bytes long and JSON-encoded; it includes an XHTML version of the text content of the PowerPoint, and some metadata.
The multipart-result.txt is 7,352,348 bytes long and contains mainly a large sequence of Chinese characters, or at least, random data being interpreted as Chinese characters.
This example was running against Solr 8.4 on a Linux server from our cloud Solr supplier. On another Linux (Ubuntu 18) server that I set up myself I got the same results using various other Solr versions. Running against localhost which is a Windows 10 machine with Solr 8.5, I get slightly different results; the non-multipart works correctly but the multipart-result.txt in that case is a slightly more helpful error 500 message:
My conclusion is that even though both versions of this command (-F myfile=@file, and --data-binary @file) are shown in the documentation, they clearly don't work equally.
Note: Although I've reproduced this using command-line curl to simplify this report, this is actually the result of a highly tortuous debugging process where I eventually managed to track down why a search index (generated by an open source learning system, Moodle, which currently uses the multipart post approach although I might have to change that) was using up too much disk space...
I'm going to try to remove private data from the offending file and attach it here.