[ 
https://issues.apache.org/jira/browse/SOLR-4143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534046#comment-13534046
 ] 

Shawn Heisey commented on SOLR-4143:
------------------------------------

bq. This seems like the right approach (as opposed to adding more parameters). 
Isn't the fix for this entirely on the client side (i.e. if "qt" starts with 
slash, remove it and set the URL path)?

I do like that idea.  It would be a lot cleaner than my fix, as it wouldn't 
involve any new methods or parameters.  A quick mental review doesn't find 
anything wrong with it, but my knowledge may not be deep enough.  If you also 
don't see any potential fallout, I can make a new patch that would just nuke 
CommonParams.QT from the final request whenever it starts with slash.

My current fix is also entirely on the client side.  This latest version of 
setRequestHandler adds qt.pathonly=true as a parameter to the request if you 
pass it a true boolean.  If that parameter is present when the request is 
actually made by implementations of SolrServer, then it is removed, along with 
qt, after the request path is set.  As far as I can tell, nothing behaves any 
differently on the server side in the latest patch version.  With earlier 
versions, the server side did behave differently, which is bad.

                
> setRequestHandler - option to not set qt parameter
> --------------------------------------------------
>
>                 Key: SOLR-4143
>                 URL: https://issues.apache.org/jira/browse/SOLR-4143
>             Project: Solr
>          Issue Type: Improvement
>          Components: clients - java
>    Affects Versions: 4.0
>         Environment: solr-impl    4.1-SNAPSHOT 1416639M - ncindex - 
> 2012-12-03 12:54:38
>            Reporter: Shawn Heisey
>             Fix For: 4.1, 5.0
>
>         Attachments: SOLR-4143.patch, SOLR-4143.patch, SOLR-4143.patch, 
> SOLR-4143.patch, SOLR-4143.patch
>
>
> The setRequestHandler method does what I expect in one way - it changes the 
> URL path from /select to the String argument.  It is however doing something 
> that I did not expect, which is setting the qt parameter on the query as 
> well.  Here is the code:
> private static final String PING_HANDLER = "/admin/ping";
> query.setRequestHandler(PING_HANDLER);
> This is resulting in the following exception being logged in my Solr 3.5.0 
> servers.  I am not including the whole exception, because this issue is for 
> SolrJ 4, not Solr 3.5, and the 3.5 version is working as it was designed.
> {code}
> Dec 3, 2012 4:04:01 PM org.apache.solr.common.SolrException log
> SEVERE: org.apache.solr.common.SolrException: Cannot execute the 
> PingRequestHandler recursively
>         at 
> org.apache.solr.handler.PingRequestHandler.handleRequestBody(PingRequestHandler.java:60)
>         at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:208)
> {code}
> I believe it would be useful to include an alternate setRequestHandler method 
> that includes a boolean option deciding whether or not to also set the qt 
> parameter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to