Class BucketBasedJsonFacet
- java.lang.Object
-
- org.apache.solr.client.solrj.response.json.BucketBasedJsonFacet
-
public class BucketBasedJsonFacet extends Object
Represents the top-level response for a bucket-based JSON facet (i.e. "terms" or "range") Allows access to JSON like:{ "numBuckets": 2, "buckets": [ {...}, {...} ] }Allows access to all top-level "terms" and "range" response properties (e.g.
allBuckets,numBuckets,before, etc.)
-
-
Field Summary
Fields Modifier and Type Field Description static intUNSET_FLAG
-
Constructor Summary
Constructors Constructor Description BucketBasedJsonFacet(NamedList<Object> bucketBasedFacet)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetAfter()Deprecated.this method can trigger ClassCastException's if the returned value is a long.longgetAfterCount()The count of all records whose field value follows theendof this "range" facet This value is only present if the user has specifically requested it with theotheroption.longgetAllBuckets()The sum cardinality of all buckets in the "terms" facet.intgetBefore()Deprecated.this method can trigger ClassCastException's if the returned value is a long.longgetBeforeCount()The count of all records whose field value precedes thestartof this "range" facet This value is only present if the user has specifically requested it with theotheroption.intgetBetween()Deprecated.this method can trigger ClassCastException's if the returned value is a long.longgetBetweenCount()The count of all records whose field value falls betweenstartandend.List<BucketJsonFacet>getBuckets()Retrieves the facet buckets returned by the server.intgetNumBuckets()Deprecated.this method can trigger ClassCastException's if the returned value is a long.longgetNumBucketsCount()The total number of buckets found in the domain (of which the returned buckets are only a part).
-
-
-
Field Detail
-
UNSET_FLAG
public static final int UNSET_FLAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBuckets
public List<BucketJsonFacet> getBuckets()
Retrieves the facet buckets returned by the server.
-
getNumBuckets
public int getNumBuckets()
Deprecated.this method can trigger ClassCastException's if the returned value is a long. In the future it will return a 'long' instead to avoid this problem. Until then, usegetNumBucketsCount()instead.The total number of buckets found in the domain (of which the returned buckets are only a part). This value can only be computed on "terms" facets where the user has specifically requested it with thenumBucketsoption.UNSET_FLAGis returned if this is a "range" facet ornumBucketscomputation was not requested in the intiial request.
-
getNumBucketsCount
public long getNumBucketsCount()
The total number of buckets found in the domain (of which the returned buckets are only a part). This value can only be computed on "terms" facets where the user has specifically requested it with thenumBucketsoption.UNSET_FLAGis returned if this is a "range" facet ornumBucketscomputation was not requested in the intiial request.
-
getAllBuckets
public long getAllBuckets()
The sum cardinality of all buckets in the "terms" facet. Note that for facets on multi-valued fields, documents may belong to multiple buckets, makinggetAllBuckets()return a result greater than the number of documents in the domain.This value is only present if the user has specifically requested it with the
allBucketsoption.UNSET_FLAGis returned if this is not the case.
-
getBefore
public int getBefore()
Deprecated.this method can trigger ClassCastException's if the returned value is a long. In the future it will return a 'long' instead to avoid this problem. Until then, usegetBeforeCount()instead.The count of all records whose field value precedes thestartof this "range" facet This value is only present if the user has specifically requested it with theotheroption.UNSET_FLAGis returned if this is not the case.
-
getBeforeCount
public long getBeforeCount()
The count of all records whose field value precedes thestartof this "range" facet This value is only present if the user has specifically requested it with theotheroption.UNSET_FLAGis returned if this is not the case.
-
getAfter
public int getAfter()
Deprecated.this method can trigger ClassCastException's if the returned value is a long. In the future it will return a 'long' instead to avoid this problem. Until then, usegetAfterCount()instead.The count of all records whose field value follows theendof this "range" facet This value is only present if the user has specifically requested it with theotheroption.UNSET_FLAGis returned if this is not the case.
-
getAfterCount
public long getAfterCount()
The count of all records whose field value follows theendof this "range" facet This value is only present if the user has specifically requested it with theotheroption.UNSET_FLAGis returned if this is not the case.
-
getBetween
public int getBetween()
Deprecated.this method can trigger ClassCastException's if the returned value is a long. In the future it will return a 'long' instead to avoid this problem. Until then, usegetBetweenCount()instead.The count of all records whose field value falls betweenstartandend. This value is only present if the user has specifically requested it with theotheroption.UNSET_FLAGis returned if this is not the case.
-
getBetweenCount
public long getBetweenCount()
The count of all records whose field value falls betweenstartandend. This value is only present if the user has specifically requested it with theotheroption.UNSET_FLAGis returned if this is not the case.
-
-