cancel
Showing results for 
Search instead for 
Did you mean: 

Solr - Request-URI Too Long

Former Member
0 Kudos

Hi we're getting Solr server error

non ok status: 414, message:Request-URI Too Long

with phrases long 10-20 chars in the auto-suggest search box. Is this supposed to happen? Hybris 6.1.0.2

 Caused by: de.hybris.platform.solrfacetsearch.search.FacetSearchException: Error from server at http://localhost:8983/solr/master_mw_Product: non ok status: 414, message:Request-URI Too Long
         at de.hybris.platform.solrfacetsearch.search.impl.LegacyFacetSearchStrategy.search(LegacyFacetSearchStrategy.java:170) ~[solrfacetsearchserver.jar:?]
         ... 135 more
 Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/master_mw_Product: non ok status: 414, message:Request-URI Too Long
         at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:493) ~[solr-solrj-5.3.0.jar:5.3.0 1696229 - noble - 2015-08-17 17:10:45]
         at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:234) ~[solr-solrj-5.3.0.jar:5.3.0 1696229 - noble - 2015-08-17 17:10:45]
         at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:226) ~[solr-solrj-5.3.0.jar:5.3.0 1696229 - noble - 2015-08-17 17:10:45]
         at org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:526) ~[solr-solrj-5.3.0.jar:5.3.0 1696229 - noble - 2015-08-17 17:10:45]
         at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:135) ~[solr-solrj-5.3.0.jar:5.3.0 1696229 - noble - 2015-08-17 17:10:45]
         at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:943) ~[solr-solrj-5.3.0.jar:5.3.0 1696229 - noble - 2015-08-17 17:10:45]
         at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:958) ~[solr-solrj-5.3.0.jar:5.3.0 1696229 - noble - 2015-08-17 17:10:45]
         at de.hybris.platform.solrfacetsearch.search.impl.LegacyFacetSearchStrategy.queryInternal(LegacyFacetSearchStrategy.java:208) ~[solrfacetsearchserver.jar:?]
         at de.hybris.platform.solrfacetsearch.search.impl.LegacyFacetSearchStrategy.search(LegacyFacetSearchStrategy.java:164) ~[solrfacetsearchserver.jar:?]
         ... 135 more

thanks nicola

[1]: /storage/temp/8379-immagine-9.png

Former Member
0 Kudos

it seems like it's blocked at an http level even before reaching solr webapp https://issues.alfresco.com/jira/browse/SEARCH-164

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can override the facet search strategy and change the method from GET to POST:
final QueryResponse queryResponse = solrClient.query(solrQuery, METHOD.POST);

Former Member
0 Kudos

thanks , we followed your lead and extended DefaultFacetSearchStrategy and LegacyFacetSearchStrategy

Answers (3)

Answers (3)

Former Member

you can to do that in Solr Config (Hybris 6.4):

INSERT_UPDATE SolrServerConfig ; name[unique=true] ; mode(code) ; solrQueryMethod(code) ; $serverConfigName ; standalone ; POST

0 Kudos

It looks like this attribute is only available as of version 6.5

david_levy1
Explorer
0 Kudos

The correct impex would be:

INSERT_UPDATE SolrServerConfig ; name[unique=true] ; mode(code) ; username   ; password  ; indexingUsername   ; indexingPassword ; solrQueryMethod
;$serverConfigName  ; asd; asd; asd; asd; asd; POST

If you're using backoffice you can set it to POST it by changing Solr Query Method property as depicted in the attached screenshot.

Former Member
0 Kudos

This could work with newer Hybris versions but he's using 6.1.

Former Member
0 Kudos

What Hybris version are you using?

Former Member

Option B) is to increase the request header size for jetty then you can still stick to the GET calls without any code changes.

/ext-commerce/solrserver/resources/solr/server/etc/jetty.xml

 <Set name="requestHeaderSize"><Property name="solr.jetty.request.header.size" default="8192" /></Set>

Setting this to "65536" should also solve your problems.

Former Member
0 Kudos

hi I like your solution much more, we found the same suggestion in the Alfresco link in my question but wasn't able to find out where to insert it in the hybris codebase.

Thanks a lot! nicola

Former Member
0 Kudos

Hi , easiest way would be to patch this file "ant customize". To do this create the folder stucture "/ext-commerce/solrserver/resources/solr/server/etc/" in your config/customize folder and place the updated jetty.xml inside the created folder. When you then run ant customize the file will be updated.

On your production environments you'll have to manually update this jetty.xml as the solr servers will most likely be on different machines.

Keep in mind that after a hybris upgrade you need to check the patched files and perform "ant customize again"