Class FacetRequestFactory
- java.lang.Object
-
- com.attivio.util.parser.FacetRequestFactory
-
public class FacetRequestFactory extends java.lang.ObjectExperimental: Factory for parsing/creating facet requests.Syntax: name[([param1=paramvalue[, param2=paramvalue]...)]
Parameters:
|| Parameter || Type || Facet Types ||
|minBucketCount| unsigned | All |
|maxBuckets| integer | All |
|distributedMinBucketCount| unsigned | All |
|distributedMaxBuckets| integer | All |
|sortBy|FacetRequest.SortBy| All |
|primarySort|Sort.SortOrder| All |
|secondarySort|Sort.SortOrder| All |
|facetFinder| boolean | All |
|statistics| boolean | Discrete facets, Range Facets, Date Facets |
|field|FieldExpression| Discrete Facets, Range Facets, Schema Facet (if = .fields) |
|sampleMode|ShallowMode| Discrete facets, Range Facets, Date Facets |
|maxMemory| long | All |
|case|ScopeFacetRequest.CaseMode| Discrete facets |
|range|FacetRange| Range Facets |
|filter| complex | Filter Based Facets |
|realTimeFields| boolean | Schema Facet |
|storedFields| boolean | Schema Facet |
|facetFields| boolean | Schema Facet |
|indexFields| boolean | Schema Facet |
|sortFields| boolean | Schema Facet |
|countBuckets| boolean | Schema Facet |
|countValues| boolean | Schema Facet |
|term| String | Schema Facet |
|dateIntervals| complex | Date Facet |
NOTE: This class is subject to change or removal.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFacetRequestFactory.SchemaFacetFilter
-
Constructor Summary
Constructors Constructor Description FacetRequestFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddFilter(java.lang.String label, Query filter)voidaddRange(FacetRange range)voidaddSchemaFilter(FacetRequestFactory.SchemaFacetFilter filter, boolean value)Add/clear a filter for a schema facet.voidaddTerm(java.lang.String term)NOTE: currently only applies to schema facet.FacetRequestcreateDateFacet()ScopeFacetRequest.CaseModegetCaseMode()FacetRequestFactorygetChildFacet()java.util.List<DateFacetRequest.DateFacetInterval>getDateIntervals()Intervals for calendar based date faceting.java.lang.IntegergetDistributedMaxBuckets()Multi-partition tuning parameter.java.lang.IntegergetDistributedMinBucketCount()Multi-partition tuning parameter.FacetRequestgetFacetRequest()FieldExpressiongetField()The field expression to facet over.java.util.Map<java.lang.String,Query>getFilters()Filters to compute document frequencies for.java.lang.IntegergetMaxBuckets()Get the maximum number of buckets to return.longgetMaxMemoryUsage()Max memory usage that should be used for facets.java.lang.IntegergetMinBucketCount()Get the minimum bucket count required for bucket to be returned.java.lang.StringgetName()The name of the facet.java.util.List<FacetRange>getRanges()Ranges to compute document frequencies for.ShallowModegetSampleMode()Mode for computing shallow facets.java.util.Set<FacetRequestFactory.SchemaFacetFilter>getSchemaFilter()Get the filter for fields to return for a schema facet.Sort.SortOrdergetSecondarySortOrder()Secondary sort order for facet buckets.FacetRequest.SortBygetSortBy()Sort specification for facet buckets.Sort.SortOrdergetSortOrder()Primary sort order for facet buckets.java.util.List<java.lang.String>getTerms()List of discrete facet buckets to return.booleanisCountBuckets()Iffalsebuckets will not contain counts.booleanisCountValues()Iftruebuckets will contain value counts in addition to document counts.booleanisFacetFields()Iftruefacetable fields will be returned in schema facet.booleanisFacetFinder()Iffalsefacet finder will ignore this facet.booleanisIndexedFields()Iftrueindexed fields will be returned in schema facet.booleanisRealTimeFields()Iftrueschema facet will be computed over real time fields.booleanisSortFields()Iftruesortable fields will be returned in schema facet.booleanisStatistics()trueif statistics should be computed for facet.booleanisStoredFields()Iftruestored fields will be returned in schema facet.booleanisTokens()Deprecated.Use TermVector field expression instead.voidsetCaseMode(ScopeFacetRequest.CaseMode value)voidsetChildFacet(FacetRequestFactory value)voidsetCountBuckets(boolean value)voidsetCountValues(boolean value)voidsetDateIntervals(java.util.List<DateFacetRequest.DateFacetInterval> value)voidsetDistributedMaxBuckets(java.lang.Integer value)voidsetDistributedMinBucketCount(java.lang.Integer value)voidsetFacetFinder(boolean value)voidsetField(FieldExpression value)voidsetFilters(java.util.Map<java.lang.String,Query> value)voidsetMaxBuckets(java.lang.Integer value)voidsetMaxMemoryUsage(long value)voidsetMinBucketCount(java.lang.Integer value)voidsetName(java.lang.String value)voidsetRanges(java.util.List<FacetRange> value)voidsetRealTimeFields(boolean value)voidsetSampleMode(ShallowMode value)voidsetSchemaFilter(java.util.Set<FacetRequestFactory.SchemaFacetFilter> value)voidsetSecondarySortOrder(Sort.SortOrder value)voidsetSortBy(FacetRequest.SortBy value)voidsetSortOrder(Sort.SortOrder value)voidsetStatistics(boolean value)voidsetTerms(java.util.List<java.lang.String> value)voidsetTokens(boolean value)static FacetRequesttoFacetRequest(FacetRequestFactory value)Convert aFacetRequestFactoryto aFacetRequest.static FacetRequestFactoryvalueOf(FacetRequest input)Convert aFacetRequestto aFacetRequestFactory.static FacetRequestFactoryvalueOf(StringParser reader)static FacetRequestFactoryvalueOf(java.lang.String value)
-
-
-
Method Detail
-
getName
public java.lang.String getName()
The name of the facet.This is the name that will be used for retreiving the facet response from the query response.
-
setName
public void setName(java.lang.String value)
-
isTokens
@Deprecated public boolean isTokens()
Deprecated.Use TermVector field expression instead.
-
setTokens
public void setTokens(boolean value)
-
getField
public FieldExpression getField()
The field expression to facet over.
-
setField
public void setField(FieldExpression value)
-
getSortBy
public FacetRequest.SortBy getSortBy()
Sort specification for facet buckets.
-
setSortBy
public void setSortBy(FacetRequest.SortBy value)
-
getDateIntervals
public java.util.List<DateFacetRequest.DateFacetInterval> getDateIntervals()
Intervals for calendar based date faceting.Syntax: dateIntervals=(resolution[(step)][,...]) or dateIntervals=auto
- resolution =
DateFacetRequest.DateFacetResolutionfor interval. - step = step for interval, default=1.
- resolution =
-
setDateIntervals
public void setDateIntervals(java.util.List<DateFacetRequest.DateFacetInterval> value)
-
getChildFacet
public FacetRequestFactory getChildFacet()
-
setChildFacet
public void setChildFacet(FacetRequestFactory value)
-
getSortOrder
public Sort.SortOrder getSortOrder()
Primary sort order for facet buckets.
-
setSortOrder
public void setSortOrder(Sort.SortOrder value)
-
getSecondarySortOrder
public Sort.SortOrder getSecondarySortOrder()
Secondary sort order for facet buckets.
-
setSecondarySortOrder
public void setSecondarySortOrder(Sort.SortOrder value)
-
getMaxBuckets
public java.lang.Integer getMaxBuckets()
Get the maximum number of buckets to return.If
nullmax buckets will use configured defaults.
-
setMaxBuckets
public void setMaxBuckets(java.lang.Integer value)
-
getDistributedMaxBuckets
public java.lang.Integer getDistributedMaxBuckets()
Multi-partition tuning parameter.If
nullconfigured defaults will be used.
-
setDistributedMaxBuckets
public void setDistributedMaxBuckets(java.lang.Integer value)
-
getMinBucketCount
public java.lang.Integer getMinBucketCount()
Get the minimum bucket count required for bucket to be returned.If
nullmin bucket count will use configured defaults.
-
setMinBucketCount
public void setMinBucketCount(java.lang.Integer value)
-
getDistributedMinBucketCount
public java.lang.Integer getDistributedMinBucketCount()
Multi-partition tuning parameter.If
nullconfigured defaults will be used.
-
setDistributedMinBucketCount
public void setDistributedMinBucketCount(java.lang.Integer value)
-
isStatistics
public boolean isStatistics()
trueif statistics should be computed for facet.
-
setStatistics
public void setStatistics(boolean value)
-
isFacetFinder
public boolean isFacetFinder()
Iffalsefacet finder will ignore this facet.
-
setFacetFinder
public void setFacetFinder(boolean value)
-
getSampleMode
public ShallowMode getSampleMode()
Mode for computing shallow facets.
-
setSampleMode
public void setSampleMode(ShallowMode value)
-
getMaxMemoryUsage
public long getMaxMemoryUsage()
Max memory usage that should be used for facets.NOTE: this is just a hint.
-
setMaxMemoryUsage
public void setMaxMemoryUsage(long value)
-
getSchemaFilter
public java.util.Set<FacetRequestFactory.SchemaFacetFilter> getSchemaFilter()
Get the filter for fields to return for a schema facet.
-
setSchemaFilter
public void setSchemaFilter(java.util.Set<FacetRequestFactory.SchemaFacetFilter> value)
-
isStoredFields
public boolean isStoredFields()
Iftruestored fields will be returned in schema facet.NOTE: Only applies to schema facets.
-
isIndexedFields
public boolean isIndexedFields()
Iftrueindexed fields will be returned in schema facet.NOTE: Only applies to schema facets.
-
isFacetFields
public boolean isFacetFields()
Iftruefacetable fields will be returned in schema facet.NOTE: Only applies to schema facets.
-
isSortFields
public boolean isSortFields()
Iftruesortable fields will be returned in schema facet.NOTE: Only applies to schema facets.
-
addSchemaFilter
public void addSchemaFilter(FacetRequestFactory.SchemaFacetFilter filter, boolean value)
Add/clear a filter for a schema facet.
-
isRealTimeFields
public boolean isRealTimeFields()
Iftrueschema facet will be computed over real time fields.NOTE: Only applies to schema facet.
-
setRealTimeFields
public void setRealTimeFields(boolean value)
-
isCountBuckets
public boolean isCountBuckets()
Iffalsebuckets will not contain counts.If document frequencies are not needed, setting this to
falsewill result in faster computation.NOTE: Currently only applies to schema facet.
-
setCountBuckets
public void setCountBuckets(boolean value)
-
isCountValues
public boolean isCountValues()
Iftruebuckets will contain value counts in addition to document counts.NOTE: Setting this to
truewill result in slower facet computation.NOTE: Currently only applies to schema facet.
-
setCountValues
public void setCountValues(boolean value)
-
getCaseMode
public ScopeFacetRequest.CaseMode getCaseMode()
-
setCaseMode
public void setCaseMode(ScopeFacetRequest.CaseMode value)
-
getTerms
public java.util.List<java.lang.String> getTerms()
List of discrete facet buckets to return.NOTE: currently only supported by schema facet.
-
setTerms
public void setTerms(java.util.List<java.lang.String> value)
-
addTerm
public void addTerm(java.lang.String term)
NOTE: currently only applies to schema facet.
-
getFilters
public java.util.Map<java.lang.String,Query> getFilters()
Filters to compute document frequencies for.Syntax: filter=(label, queryfilter)
- label = String label for returned bucket.
- queryfilter = Quoted string containing query in advanced query language.
-
setFilters
public void setFilters(java.util.Map<java.lang.String,Query> value)
-
addFilter
public void addFilter(java.lang.String label, Query filter)
-
getRanges
public java.util.List<FacetRange> getRanges()
Ranges to compute document frequencies for.
-
setRanges
public void setRanges(java.util.List<FacetRange> value)
-
addRange
public void addRange(FacetRange range)
-
createDateFacet
public FacetRequest createDateFacet()
-
getFacetRequest
public FacetRequest getFacetRequest()
-
valueOf
public static FacetRequestFactory valueOf(java.lang.String value)
-
toFacetRequest
public static FacetRequest toFacetRequest(FacetRequestFactory value)
Convert aFacetRequestFactoryto aFacetRequest.
-
valueOf
public static FacetRequestFactory valueOf(FacetRequest input)
Convert aFacetRequestto aFacetRequestFactory.
-
valueOf
public static FacetRequestFactory valueOf(StringParser reader)
-
-