Class FacetRequestFactory
- java.lang.Object
-
- com.attivio.util.parser.FacetRequestFactory
-
public class FacetRequestFactory extends java.lang.Object
Experimental: 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 class
FacetRequestFactory.SchemaFacetFilter
-
Constructor Summary
Constructors Constructor Description FacetRequestFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addFilter(java.lang.String label, Query filter)
void
addRange(FacetRange range)
void
addSchemaFilter(FacetRequestFactory.SchemaFacetFilter filter, boolean value)
Add/clear a filter for a schema facet.void
addTerm(java.lang.String term)
NOTE: currently only applies to schema facet.FacetRequest
createDateFacet()
ScopeFacetRequest.CaseMode
getCaseMode()
FacetRequestFactory
getChildFacet()
java.util.List<DateFacetRequest.DateFacetInterval>
getDateIntervals()
Intervals for calendar based date faceting.java.lang.Integer
getDistributedMaxBuckets()
Multi-partition tuning parameter.java.lang.Integer
getDistributedMinBucketCount()
Multi-partition tuning parameter.FacetRequest
getFacetRequest()
FieldExpression
getField()
The field expression to facet over.java.util.Map<java.lang.String,Query>
getFilters()
Filters to compute document frequencies for.java.lang.Integer
getMaxBuckets()
Get the maximum number of buckets to return.long
getMaxMemoryUsage()
Max memory usage that should be used for facets.java.lang.Integer
getMinBucketCount()
Get the minimum bucket count required for bucket to be returned.java.lang.String
getName()
The name of the facet.java.util.List<FacetRange>
getRanges()
Ranges to compute document frequencies for.ShallowMode
getSampleMode()
Mode for computing shallow facets.java.util.Set<FacetRequestFactory.SchemaFacetFilter>
getSchemaFilter()
Get the filter for fields to return for a schema facet.Sort.SortOrder
getSecondarySortOrder()
Secondary sort order for facet buckets.FacetRequest.SortBy
getSortBy()
Sort specification for facet buckets.Sort.SortOrder
getSortOrder()
Primary sort order for facet buckets.java.util.List<java.lang.String>
getTerms()
List of discrete facet buckets to return.boolean
isCountBuckets()
Iffalse
buckets will not contain counts.boolean
isCountValues()
Iftrue
buckets will contain value counts in addition to document counts.boolean
isFacetFields()
Iftrue
facetable fields will be returned in schema facet.boolean
isFacetFinder()
Iffalse
facet finder will ignore this facet.boolean
isIndexedFields()
Iftrue
indexed fields will be returned in schema facet.boolean
isRealTimeFields()
Iftrue
schema facet will be computed over real time fields.boolean
isSortFields()
Iftrue
sortable fields will be returned in schema facet.boolean
isStatistics()
true
if statistics should be computed for facet.boolean
isStoredFields()
Iftrue
stored fields will be returned in schema facet.boolean
isTokens()
Deprecated.Use TermVector field expression instead.void
setCaseMode(ScopeFacetRequest.CaseMode value)
void
setChildFacet(FacetRequestFactory value)
void
setCountBuckets(boolean value)
void
setCountValues(boolean value)
void
setDateIntervals(java.util.List<DateFacetRequest.DateFacetInterval> value)
void
setDistributedMaxBuckets(java.lang.Integer value)
void
setDistributedMinBucketCount(java.lang.Integer value)
void
setFacetFinder(boolean value)
void
setField(FieldExpression value)
void
setFilters(java.util.Map<java.lang.String,Query> value)
void
setMaxBuckets(java.lang.Integer value)
void
setMaxMemoryUsage(long value)
void
setMinBucketCount(java.lang.Integer value)
void
setName(java.lang.String value)
void
setRanges(java.util.List<FacetRange> value)
void
setRealTimeFields(boolean value)
void
setSampleMode(ShallowMode value)
void
setSchemaFilter(java.util.Set<FacetRequestFactory.SchemaFacetFilter> value)
void
setSecondarySortOrder(Sort.SortOrder value)
void
setSortBy(FacetRequest.SortBy value)
void
setSortOrder(Sort.SortOrder value)
void
setStatistics(boolean value)
void
setTerms(java.util.List<java.lang.String> value)
void
setTokens(boolean value)
static FacetRequest
toFacetRequest(FacetRequestFactory value)
Convert aFacetRequestFactory
to aFacetRequest
.static FacetRequestFactory
valueOf(FacetRequest input)
Convert aFacetRequest
to aFacetRequestFactory
.static FacetRequestFactory
valueOf(StringParser reader)
static FacetRequestFactory
valueOf(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.DateFacetResolution
for 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
null
max buckets will use configured defaults.
-
setMaxBuckets
public void setMaxBuckets(java.lang.Integer value)
-
getDistributedMaxBuckets
public java.lang.Integer getDistributedMaxBuckets()
Multi-partition tuning parameter.If
null
configured 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
null
min 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
null
configured defaults will be used.
-
setDistributedMinBucketCount
public void setDistributedMinBucketCount(java.lang.Integer value)
-
isStatistics
public boolean isStatistics()
true
if statistics should be computed for facet.
-
setStatistics
public void setStatistics(boolean value)
-
isFacetFinder
public boolean isFacetFinder()
Iffalse
facet 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()
Iftrue
stored fields will be returned in schema facet.NOTE: Only applies to schema facets.
-
isIndexedFields
public boolean isIndexedFields()
Iftrue
indexed fields will be returned in schema facet.NOTE: Only applies to schema facets.
-
isFacetFields
public boolean isFacetFields()
Iftrue
facetable fields will be returned in schema facet.NOTE: Only applies to schema facets.
-
isSortFields
public boolean isSortFields()
Iftrue
sortable 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()
Iftrue
schema facet will be computed over real time fields.NOTE: Only applies to schema facet.
-
setRealTimeFields
public void setRealTimeFields(boolean value)
-
isCountBuckets
public boolean isCountBuckets()
Iffalse
buckets will not contain counts.If document frequencies are not needed, setting this to
false
will result in faster computation.NOTE: Currently only applies to schema facet.
-
setCountBuckets
public void setCountBuckets(boolean value)
-
isCountValues
public boolean isCountValues()
Iftrue
buckets will contain value counts in addition to document counts.NOTE: Setting this to
true
will 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 aFacetRequestFactory
to aFacetRequest
.
-
valueOf
public static FacetRequestFactory valueOf(FacetRequest input)
Convert aFacetRequest
to aFacetRequestFactory
.
-
valueOf
public static FacetRequestFactory valueOf(StringParser reader)
-
-