You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Stefan Matheis (steffkes) (JIRA)" <ji...@apache.org> on 2014/08/22 14:50:13 UTC

[jira] [Commented] (SOLR-6404) Solr WebGui does not correctly prefill query parameters

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

Stefan Matheis (steffkes) commented on SOLR-6404:
-------------------------------------------------

Jakob that's correct, the current functionality is pretty simple and works only for textfields (not checkboxes, which would be what {{defType}} & {{debugQuery}} are using) and in case that a field with the very same name exists (which isn't true for {{q.op}}).

that's the relevant part of the code:

{code:title=http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/scripts/query.js?view=markup#l209}for( var key in context.params )
{
  if( 'string' === typeof context.params[key] )
  {
    fields++;
    $( '[name="' + key + '"]', query_form )
      .val( context.params[key] );
  }
}{code}

a possible extension would be, to check if the field is a checkbox (rather than a textfield) and enable/disable it based on the given value. all fields that don't have an matching field could be combined into the "Raw Query Parameters" which is currently the only possibility to send various data from the Query UI

> Solr WebGui does not correctly prefill query parameters
> -------------------------------------------------------
>
>                 Key: SOLR-6404
>                 URL: https://issues.apache.org/jira/browse/SOLR-6404
>             Project: Solr
>          Issue Type: Improvement
>          Components: web gui
>    Affects Versions: 4.9
>            Reporter: Jakob Furrer
>            Priority: Minor
>
> In my custom application that sends requests to Solr, I log the Solr query requests for debugging purposes.
> To do so, I append the original query parameters from my SolrJ select request (see org.apache.solr.client.solrj.SolrQuery) to my Solr WebGui URL like this:
> String debuggingUrl = "http://my-machine-name:8080/Solr/#/MyCore/query?" + String.valueOf(solrQuery) + "&debugQuery=on";
> When the debuggingUrl is later opened in a web browser, the query parameters are conveniently prefilled in the textfields of the form and the query can be sent and analyzed.
> Great features. Saved me a lot of time when I was finetuning my queries.
> Unfortunately, not all parameters that occur in my debuggingUrl are taken over in the web form correctly.
> Not knowing the full range of possible parameters, I have not performed an exhaustive test, but I can confirm that the following currently fail:
> [a]
> defType=edismax
> There is a check box named "edismax" in the form, but the box is not pre-checked, while it actually should be.
> [b]
> debugQuery=on
> There is a check box named "debugQuery" in the form, but the box is not pre-checked, while it actually should be.
> [c]
> q.op=AND
> There is no text field or check box or dropdown item named "q.op".
> Not even after checking on "dismax" and "edismax" which both offer additional parameters to be set.
> However, there should be input option to set this parameter and it should be preset when "q.op=AND" is defined in the URL.
> The parameters listed as [a], [b] and [c] are important to my use case, that's why I noticed that they are not correctly handled.
> However, there might be others that are missing or incorrectly handled.
> The issue described above can be reproduced using the following URL on a standard example Solr instance on Jetty.
> http://localhost:8983/solr/#/collection1/query?q=Maxtor%20Samsung&fl=id,name,features&wt=json&indent=true&defType=edismax&q.op=AND&debugQuery=on



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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