Class TermsFacetMap
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
Ready for use in JsonQueryRequest.withFacet(String, Map)
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetThis()includeAllBucketsUnionBucket(boolean shouldInclude) Creates a bucket representing the union of all other buckets.includeMissingBucket(boolean missingBucket) Indicates that Solr should create a bucket corresponding to documents missing the field used by this facet.includeTotalNumBuckets(boolean numBuckets) Indicates that Solr should include the total number of buckets for this facet.setBucketOffset(int numToSkip) Indicates that Solr should skip over the N buckets for this facet.Indicate which method should be used to compute the facet.setLimit(int maximumBuckets) Indicates the maximum number of buckets to be returned by this facet.setMinCount(int minCount) Indicates that the facet results should not include any buckets with a count less thanminCount.setOverRefine(int numExtraBuckets) Indicates how many extra buckets to request during distributed-facet-refining beyond those required bysetLimit(int)setOverRequest(int numExtraBuckets) Indicates the number of additional buckets to request internally beyond those required bysetLimit(int).setPreliminarySort(String preliminarySort) Indicates an approximate sort calculation to be performed during initial bucket generation and collection.Indicates the desired ordering for the returned buckets.setTermPrefix(String termPrefix) Indicates that the facet should only produce buckets for terms that start with the specified prefix.useDistributedFacetRefining(boolean useRefining) Indicates whether this facet should use distributed facet refining.Methods inherited from class org.apache.solr.client.solrj.request.json.JsonFacetMap
withDomain, withStatSubFacet, withSubFacetMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
TermsFacetMap
-
-
Method Details
-
getThis
- Specified by:
getThisin classJsonFacetMap<TermsFacetMap>
-
setBucketOffset
Indicates that Solr should skip over the N buckets for this facet.Used for "paging" in facet results. Defaults to 0 if not provided.
- Parameters:
numToSkip- the number of buckets to skip over before selecting the buckets to return
-
setLimit
Indicates the maximum number of buckets to be returned by this facet.Defaults to 10 if not specified.
-
setSort
Indicates the desired ordering for the returned buckets.Values can be based on 'count' (the number of results in each bucket), 'index' (the natural order of bucket values), or on any stat facet that occurs in the bucket. Defaults to "count desc" if not specified.
By default,
sortis calculated for all buckets generated by all shards. Ifsortis expensive a cheaper approximation can be provided usingsetPreliminarySort(String)that will be run instead during bucket collection.- See Also:
-
setPreliminarySort
Indicates an approximate sort calculation to be performed during initial bucket generation and collection.Values can be based on 'count' (the number of results in each bucket), 'index' (the natural order of bucket values), or on any stat facet that occurs in the bucket. Defaults to "count desc" if not specified.
When no
prelim_sortis provided,sortis calculated on all buckets generated by all shards. Ifsortis expensive,prelim_sortcan be used to provide a cheaper approximation calculation that is run instead on initial bucket collection.sortis still used when assembling the final list of buckets.- See Also:
-
setOverRequest
Indicates the number of additional buckets to request internally beyond those required bysetLimit(int).Defaults to -1 if not specified, which triggers some heuristic guessing based on other settings.
-
useDistributedFacetRefining
Indicates whether this facet should use distributed facet refining."Distributed facet refining" is a second, optional stage in the facet process that ensures that counts for the returned buckets are exact. Enabling it is a tradeoff between precision and speed/performance. Defaults to false if not specified.
- Parameters:
useRefining- true if distributed facet refining should be used; false otherwise
-
setOverRefine
Indicates how many extra buckets to request during distributed-facet-refining beyond those required bysetLimit(int)Defaults to -1 if not specified, which triggers some heuristic guessing based on other settings.
-
setMinCount
Indicates that the facet results should not include any buckets with a count less thanminCount.Defaults to 1 if not specified.
-
includeMissingBucket
Indicates that Solr should create a bucket corresponding to documents missing the field used by this facet.Defaults to false if not specified.
- Parameters:
missingBucket- true if the special "missing" bucket should be created; false otherwise
-
includeTotalNumBuckets
Indicates that Solr should include the total number of buckets for this facet.Note that this is different from the number of buckets returned. Defaults to false if not specified
- Parameters:
numBuckets- true if the "numBuckets" field should be computed; false otherwise
-
includeAllBucketsUnionBucket
Creates a bucket representing the union of all other buckets.For multi-valued fields this is different from a bucket for the entire domain, since documents can belong to multiple buckets. Defaults to false if not specified.
- Parameters:
shouldInclude- true if the union bucket "allBuckets" should be computed; false otherwise
-
setTermPrefix
Indicates that the facet should only produce buckets for terms that start with the specified prefix. -
setFacetMethod
Indicate which method should be used to compute the facet.Defaults to "smart" if not specified, which has Solr guess which computation method will be most efficient.
-