Přejít na menu

Solr - content length error when loading many data

Správa článků

Vyhledávání Vyhledávání
30.11.2015 19:46
,
Počet přečtení: 2114

When many data are found and returned by Solr, the request content lenghth limit may be reached and error 400 may occur.

Example of error returned by Solr:

"Expected mime type application/octet-stream but got application/xml. <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<response>\n<lst name=\"error\"><str name=\"msg\">application/x-www-form-urlencoded content length (3091319 bytes) exceeds upload limit of 2048 KB</str><int name=\"code\">400</int></lst>\n</response>\n

How to solve it:

Direct solution

  1. Increase the limit in your solrconfig.xml file, for example:
    <requestDispatcher handleSelect="false" >
            <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" formdataUploadLimitInKB="32768"
                            addHttpRequestToContext="false"/>
            <httpCaching never304="true" />
        </requestDispatcher>
  2. Restart your Solr instances:
    service solr-server restart

Workarounds

  • if you does not need all the data, set smaller rows limit in the query
  • use shorter format for the response - use CSV format and retrieve the necessary fields only
Vytvořil 30. listopadu 2015 v 19:54:53 mira. Upravováno 15x, naposledy 30. listopadu 2015 v 19:59:49, mira


Diskuze ke článku

Vložení nového komentáře
*
*
*