Reputation: 75
I am trying to query data (using solr) and get castleid granularity.
I have a local running instance of Solr 4.10.
On a begging I've made simple query like in solr wiki for range faceting: Solr examples for range faceting
I tried the following query:
&facet=true
&facet.range=castleid
&f.castleid.facet.range.start=0
&f.castleid.facet.range.end=1000
&f.castleid.facet.range.gap=1,2,3,10
url for this query:
select?q=table%3Acontent&wt=json&indent=true&facet=true&facet.range=castleid&f.castleid.facet.range.start=0&f.castleid.facet.range.end=10000&facet.range.gap=1%2C2%2C3%2C10
The error I am getting is:
"Can't parse gap 1,2,3,10 for field: castleid"
Am I doing something wrong or it is impossible to make ranges this way?
Upvotes: 3
Views: 729
Reputation: 75
Full answer for my example is:
I enabled interval by setting docValues=“true” in the schema for castleid field. And corresponding query should look like:
&facet=true
&facet.interval=castleid
&f.castleid.facet.interval.set=[0,1]
&f.castleid.facet.interval.set=[2,2]
&f.castleid.facet.interval.set=[3,3]
&f.castleid.facet.interval.set=[4,13]
&f.castleid.facet.interval.set=[14,23]
&f.castleid.facet.interval.set=[24,33]
.
.
.
&f.castleid.facet.interval.set=[994,1003]
Upvotes: 2
Reputation: 52902
The example refers to a experimental feature that, as far as I can see, is not committed in the current version.
You might be able to solve it by using Interval Faceting instead (although that will require you to create the interval buckets yourself).
Upvotes: 3