And for the curious, there’s examples of this sort of thing here… 
https://github.com/apache/lucene-solr/tree/master/solr/example/films 
<https://github.com/apache/lucene-solr/tree/master/solr/example/films>

This is one for Alexandre to take note of ;)   #solr_examples_protips (that 
admittedly could be documented better somewhere no doubt)

        Erik


> On Sep 20, 2016, at 3:31 PM, Matt Work Coarr <mattcoarr.w...@gmail.com> wrote:
> 
> Awesome! Thanks Erik and Erick!!
> 
> To close the loop on this, I was able to create a paramset via the rest api
> and then use it in a query via ?paramSet=myParams and it's working!!
> 
> Hopefully this information will help someone else...
> 
> My dataset has some text fields that should be used in more-like-this and
> it has some machine learning classifier score fields that vary from 0..1
> that I want to be able to do facets over different scores.
> 
> Here's the rest call to create my paramset:
> 
> export SOLR_BASE=http://myserver.mycompany.com:8983/solr
> export CORE=mycore
> 
> curl "$SOLR_BASE/$CORE/config/params" -H 'Content-type:application/json'
> -d '{
>  "update":{
>    "myParams":{
>      "rows":"5",
>      "facet": "on",
>      "facet.range":
> ["classificationfield1","classificationfield2","classificationfield3"],
>      "facet.range.start": "0.5",
>      "facet.range.end": "1.0",
>      "facet.range.gap": "0.1",
>      "facet.range.other" : "all",
>      "fl":
> "title,textfield1,textfield2,classificationfield1,classificationfield2,classificationfield3,score",
>      "mlt": "on",
>      "mlt.fl": "textfield1,textfield2",
>      "df":"_text_"}}
> }'
> 
> 
> Then I needed to add this new paramset to the *END* of the list in the
> requestHandler's useParams attribute:
> 
> <requestHandler name="/browse" class="solr.SearchHandler"
> useParams="query,facets,velocity,browse,myParams">
> 
> 
> A few wiki pages that I found useful...
> 
>   - "Request Parameters API":
>      -
>      https://cwiki.apache.org/confluence/display/solr/Request+Parameters+API
>   - "InitParms in SolrConfig"
>      -
>      https://cwiki.apache.org/confluence/display/solr/InitParams+in+SolrConfig
>      - "Config API"
>      - https://cwiki.apache.org/confluence/display/solr/Config+API
> 
> Matt

Reply via email to