public class FacetRequest extends Object implements Cloneable, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
FacetRequest.SortBy
Enumeration listing types of sorts for a facet request
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_MAX_MEMORY_USAGE
Default max memory usage (512K).
|
static Sort.SortOrder |
DEFAULT_PRIMARY_SORT
Default primary Sort
|
static ShallowMode |
DEFAULT_SAMPLE_MODE
Default sample mode for date facets (POPULATION)
|
static Sort.SortOrder |
DEFAULT_SECONDARY_SORT
Default secondary Sort
|
static FacetRequest.SortBy |
DEFAULT_SORT_BY
Default sort by
|
Modifier | Constructor and Description |
---|---|
|
FacetRequest() |
protected |
FacetRequest(boolean facetFinder) |
|
FacetRequest(FieldExpression field) |
protected |
FacetRequest(FieldExpression field,
boolean facetFinder) |
|
FacetRequest(String fieldName) |
protected |
FacetRequest(String fieldName,
boolean facetFinder) |
|
FacetRequest(String name,
FieldExpression field) |
Modifier and Type | Method and Description |
---|---|
protected int |
addName(StringBuilder buffer) |
protected int |
addParameter(StringBuilder buffer,
int index,
String key,
Object value)
Add A REST Parameter To
buffer . |
protected int |
addParameters(StringBuilder buffer,
int index) |
FacetRequest |
clone() |
boolean |
equals(Object other) |
Comparator<FacetBucket> |
getBucketComparator()
Get a comparator for sorting buckets according to this FacetRequests sort ordering.
|
int |
getDistributedMaxBuckets()
Get the number of buckets to return from distributed indexes.
|
int |
getDistributedMinBucketCount()
Gets the minimum count that returned buckets must have for distributed indexes.
|
String |
getField()
Get the field to request a facet for.
|
FieldExpression |
getFieldExpression()
Get the
FieldExpression to request a facet for. |
int |
getMaxBuckets()
Get the maximum number of buckets to return.
|
long |
getMaxMemoryUsage()
Get the max memory usage allowed during computation (in bytes).
|
int |
getMinBucketCount()
Gets the minimum count that returned buckets must have.
|
String |
getName()
Get the name for this facet request.
|
Sort.SortOrder |
getPrimarySortOrder()
Gets the primary sort order for sorting buckets.
|
Integer |
getRawDistributedMaxBuckets()
Same as
getDistributedMaxBuckets() except a null value is returned if no value is set. |
Integer |
getRawDistributedMinBucketCount()
Same as
getDistributedMinBucketCount() except a null value is returned if no value is set. |
Integer |
getRawMaxBuckets()
Same as
getMaxBuckets() except a null value is returned if no value is set. |
Integer |
getRawMinBucketCount()
Same as
getMinBucketCount() except a null value is returned if no value is set. |
Sort.SortOrder |
getSecondarySortOrder()
Gets the secondary sort order for sorting buckets.
|
ShallowMode |
getShallowMode()
Get the sample mode for facet computation.
|
FacetRequest.SortBy |
getSortBy()
Get the field to sort buckets by
|
int |
hashCode() |
boolean |
isCalculateStatistics()
Should statistics be calculated.
|
boolean |
isFacetFinder()
true if the facet finder can replace this FacetRequest with a suggested FacetRequest. |
boolean |
isFacetTokens()
Experimental: If true, will facet on raw tokens for field.
|
void |
setCalculateStatistics(boolean value)
Set if statistics should be calculated.
|
void |
setDefaults(SchemaField schemaField)
Set default values for unset fields based on a SchemaField.
|
void |
setDistributedMaxBuckets(int value)
Set the number of buckets to return from distributed indexes.
|
void |
setDistributedMaxBuckets(Integer value)
Same as
setDistributedMaxBuckets(int) except that null value indicates default should be used. |
void |
setDistributedMinBucketCount(int value)
Sets the minimum count that returned buckets must have for distributed indexes.
|
void |
setDistributedMinBucketCount(Integer value)
Same as
setDistributedMinBucketCount(int) except that null value indicates default should be used. |
void |
setFacetFinder(boolean value)
Set if FacetFinder is allowed to provide a suggestion for this FacetRequest.
|
void |
setFacetTokens(boolean value)
Experimental: Set if facet should be generated on raw tokens for field.
|
void |
setField(String value)
Set the field to request a facet for.
|
void |
setFieldExpression(FieldExpression value)
Set the
FieldExpression to request a facet for. |
void |
setMaxBuckets(int numBuckets)
Set the maximum number of buckets to return.
|
void |
setMaxBuckets(Integer value)
Same as
setMaxBuckets(int) except that null value indicates default should be used. |
void |
setMaxMemoryUsage(long value)
Set the max memory usage allowed during computation (in bytes).
|
void |
setMinBucketCount(int value)
Sets the minimum count that returned buckets must have.
|
void |
setMinBucketCount(Integer value)
Same as
setMinBucketCount(int) except that null value indicates default should be used. |
void |
setName(String value)
Set the name for this facet request.
|
void |
setPrimarySortOrder(Sort.SortOrder order)
Sets the primary sort order for sorting buckets.
|
void |
setSecondarySortOrder(Sort.SortOrder order)
Sets the secondary sort order for sorting buckets.
|
void |
setShallowMode(ShallowMode value)
Set the sample mode for facet computation.
|
void |
setSortOrder(FacetRequest.SortBy sort)
Sets wether to sort by bucket count or bucket label.
|
void |
setSortOrder(FacetRequest.SortBy sort,
Sort.SortOrder order)
Sets wether to sort by bucket count or bucket label.
|
void |
setSortOrder(FacetRequest.SortBy sort,
Sort.SortOrder primary,
Sort.SortOrder secondary)
Sets the sort order and sort-by's.
|
String |
toString() |
static FacetRequest |
valueOf(String value)
Parse a FacetRequest from a string.
|
public static final long DEFAULT_MAX_MEMORY_USAGE
public static ShallowMode DEFAULT_SAMPLE_MODE
public static final Sort.SortOrder DEFAULT_PRIMARY_SORT
public static final Sort.SortOrder DEFAULT_SECONDARY_SORT
public static final FacetRequest.SortBy DEFAULT_SORT_BY
public FacetRequest()
public FacetRequest(String fieldName)
public FacetRequest(FieldExpression field)
public FacetRequest(String name, FieldExpression field)
protected FacetRequest(boolean facetFinder)
protected FacetRequest(String fieldName, boolean facetFinder)
protected FacetRequest(FieldExpression field, boolean facetFinder)
public String getName()
public void setName(String value)
public String getField()
public void setField(String value)
public FieldExpression getFieldExpression()
FieldExpression
to request a facet for.public void setFieldExpression(FieldExpression value)
FieldExpression
to request a facet for.public ShallowMode getShallowMode()
public void setShallowMode(ShallowMode value)
public final long getMaxMemoryUsage()
If the facet contains more data than can fit in this space, its computation will be buffered on disk.
NOTE: this is a hint. not all facet implementations support memory limitations.
public final void setMaxMemoryUsage(long value)
public boolean isFacetTokens()
NOTE: may not be available for all fields/facet requests.
public void setFacetTokens(boolean value)
NOTE: may not be available for all fields/facet requests.
public boolean isFacetFinder()
true
if the facet finder can replace this FacetRequest with a suggested FacetRequest.
This will replace a FacetRequest for a numeric field with a RangeFacetRequest when facet finder runs.
public void setFacetFinder(boolean value)
public boolean isCalculateStatistics()
public void setCalculateStatistics(boolean value)
public FacetRequest.SortBy getSortBy()
public void setDefaults(SchemaField schemaField)
public void setSortOrder(FacetRequest.SortBy sort)
public void setSortOrder(FacetRequest.SortBy sort, Sort.SortOrder order)
public void setSortOrder(FacetRequest.SortBy sort, Sort.SortOrder primary, Sort.SortOrder secondary)
sort
- the sort-byprimary
- the primary sort ordersecondary
- the secondary sort orderpublic void setPrimarySortOrder(Sort.SortOrder order)
public Sort.SortOrder getPrimarySortOrder()
public void setSecondarySortOrder(Sort.SortOrder order)
public Sort.SortOrder getSecondarySortOrder()
public int getMinBucketCount()
Buckets will not be returned if their counts are less than this value.
public Integer getRawMinBucketCount()
getMinBucketCount()
except a null
value is returned if no value is set.public void setMinBucketCount(int value)
Buckets will not be returned if their counts are less than this value.
public void setMinBucketCount(Integer value)
setMinBucketCount(int)
except that null value indicates default should be used.public int getDistributedMinBucketCount()
PERFORMANCE vs ACCURACY: this value is used for tuning performance of faceting in a distributed index setup. If this value is set to 0, bucket counts will accurate, however network traffic will increase. Increasing the value for this setting will reduce network traffic, however accuracy will decrease.
public Integer getRawDistributedMinBucketCount()
getDistributedMinBucketCount()
except a null
value is returned if no value is set.public void setDistributedMinBucketCount(int value)
PERFORMANCE vs ACCURACY: this value is used for tuning performance of faceting in a distributed index setup. If this value is set to 0, bucket counts will accurate, however network traffic will increase. Increasing the value for this setting will reduce network traffic, however accuracy will decrease.
public void setDistributedMinBucketCount(Integer value)
setDistributedMinBucketCount(int)
except that null value indicates default should be used.public int getMaxBuckets()
public Integer getRawMaxBuckets()
getMaxBuckets()
except a null
value is returned if no value is set.public void setMaxBuckets(int numBuckets)
public void setMaxBuckets(Integer value)
setMaxBuckets(int)
except that null value indicates default should be used.public int getDistributedMaxBuckets()
PERFORMANCE vs ACCURACY: this value is used for tuning performance of faceting in a distributed index setup. If this value is unset, then all buckets from sub indexes will be returned upwards (resulting in accurate counts). If this value is set, then not all buckets will be passed up from sub indexes. This will result in better network throughput, however bucket counts accuracy will suffer.
public Integer getRawDistributedMaxBuckets()
getDistributedMaxBuckets()
except a null
value is returned if no value is set.public void setDistributedMaxBuckets(int value)
PERFORMANCE vs ACCURACY: this value is used for tuning performance of faceting in a distributed index setup. If this value is unset, then all buckets from sub indexes will be returned upwards (resulting in accurate counts). If this value is set, then not all buckets will be passed up from sub indexes. This will result in better network throughput, however bucket counts accuracy will suffer.
public void setDistributedMaxBuckets(Integer value)
setDistributedMaxBuckets(int)
except that null value indicates default should be used.public Comparator<FacetBucket> getBucketComparator()
public FacetRequest clone()
protected int addName(StringBuilder buffer)
protected int addParameters(StringBuilder buffer, int index)
protected final int addParameter(StringBuilder buffer, int index, String key, Object value)
buffer
.public static FacetRequest valueOf(String value)
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.