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

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

I've heard someone saying me name? ;) I'll do the best i can Dmitry - let me 
start with this one:

Currently there is no place that uses a pre-configuration stored in solrconfig 
(or somewhere stored in the server, at all) - everything we have it either 
persisted in a cookie (auto-refresh at dataimport, timezone at logging and 
autoloading-terms at the schema-browser) or in the url (analysis-view, 
files-browser or plugins).

Initially we thought about that at some features that were implemented in the 
early days - but every feature that would use a persisted state, was based on 
some kind of user-preference rather than something that would be valid globally 
(auto-refresh at dataimport, as an example). That doesn't mean that i would be 
against having something like that (absolutely not!) - only explaining how we 
got where we are currently ;>

Regarding this issue: Jakob brought up something pretty similar in SOLR-6404 - 
where i've already described the place where i'd start digging:

{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}

that's pretty basic, but does explain why neither his use-case nor yours work 
right now out of the box. you can provide default-values for a bunch of fields 
(f.e. the query-field using {{http://host/solr/#/collection1/query?q=test}}) - 
that does not work for all fields and especially isn't updated after you change 
any input-values. that is something that already works on the analysis screen - 
where we could grab a bunch of things (:

Right off the bat, i'd go with the following steps:

* extend the string/input-field limitation, so that it would work with a 
checkbox/radiobox as well
* check the analysis view and [how it updates the 
url|http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/scripts/analysis.js?view=markup#l242]
 (kinda hacky, explantation below)
* figure out how to handle multi-valued fields (like the Filter-Query)

I know, i'm mentioning your use-case only third (and therefore last) .. for a 
comparable simple reason: it's the most complicated one - i didn't look at it 
closely, just from what i'd imagine how it could be. obviously that is just a 
suggestion and if you feel like starting with that one .. i'm all yours!

Analysis-View: i said 'kinda hacky' because it does something weird, if you 
submit the form, it builds the new url - based on all form values - redirects 
you there and then executes the actual analysis. sounds strange .. is in fact 
strange, but i couldn't figure out another way. because every time you modify 
the url (either manually or via javascript) the framework we use 
([sammy.js|http://sammyjs.org]) starts it's route matching and all - which 
doesn't play well w/ what i've wanted to do there. probably it would be worth a 
second look, the longer i'm thinking about this, the more i have the feeling 
that i've simply overlooked something, because something like that should exist 
- at least, in a more current version.

> Pre-populating values into search parameters on the query page of solr admin
> ----------------------------------------------------------------------------
>
>                 Key: SOLR-6152
>                 URL: https://issues.apache.org/jira/browse/SOLR-6152
>             Project: Solr
>          Issue Type: Improvement
>          Components: web gui
>    Affects Versions: 4.3.1
>            Reporter: Dmitry Kan
>         Attachments: prepoluate_query_parameters_query_page.bmp
>
>
> In some use cases, it is highly desirable to be able to pre-populate the 
> query page of solr admin with specific values.
> In particular use case of mine, the solr admin user must pass a date range 
> value without which the query would fail.
> It isn't easy to remember the value format for non-solr experts, so I would 
> like to have a way of hooking that value "example" into the query page.
> See the screenshot attached, where I have inserted the fq parameter with date 
> range into the Raw Query Parameters.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to