Issue regarding range faceting inside pivot facets using solrj

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Issue regarding range faceting inside pivot facets using solrj

Naman Asati
Hi

I am using Solr 6.3.0 with Fusion 1.2.8.

I am having an issue doing range faceting INSIDE the pivot faceting using
the solr-solrj-5.0.0.jar.

Let us consider 3 fields A, B and C.
I want to do a range facet for A and pivot faceting of (B, C, Range facet
of A).

Code :
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("facet.range","{!tag=r1}A") ;
params.add("f.A.facet.range.start","0") ;
params.add("f.A.facet.range.end","100") ;
params.add("f.A.facet.range.gap","10") ;
params.add("f.A.facet.range.hardend","true") ;
params.add("facet.pivot","{!range=r1}B,C") ;

The query formed from this is working fine when I copy it and hit it on the
browser, but using solrj, it gives SolrServerException.

java.lang.RuntimeException: unknown key in pivot: ranges
[{A={counts={0=0,8=3,16=4,....96=1},gap=8,start=0,end=100}}]

Please help me to figure out how to correctly use solrj to do range
faceting inside pivot faceting.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue regarding range faceting inside pivot facets using solrj

Naman Asati
Minor correction :
params.add("f.A.facet.range.gap","8") ;

On 20-Apr-2017 5:10 PM, "Naman Asati" <[hidden email]> wrote:

> Hi
>
> I am using Solr 6.3.0 with Fusion 1.2.8.
>
> I am having an issue doing range faceting INSIDE the pivot faceting using
> the solr-solrj-5.0.0.jar.
>
> Let us consider 3 fields A, B and C.
> I want to do a range facet for A and pivot faceting of (B, C, Range facet
> of A).
>
> Code :
> ModifiableSolrParams params = new ModifiableSolrParams();
> params.add("facet.range","{!tag=r1}A") ;
> params.add("f.A.facet.range.start","0") ;
> params.add("f.A.facet.range.end","100") ;
> params.add("f.A.facet.range.gap","10") ;
> params.add("f.A.facet.range.hardend","true") ;
> params.add("facet.pivot","{!range=r1}B,C") ;
>
> The query formed from this is working fine when I copy it and hit it on
> the browser, but using solrj, it gives SolrServerException.
>
> java.lang.RuntimeException: unknown key in pivot: ranges
> [{A={counts={0=0,8=3,16=4,....96=1},gap=8,start=0,end=100}}]
>
> Please help me to figure out how to correctly use solrj to do range
> faceting inside pivot faceting.
>
Loading...