public class DistinctValuesFacetExtractor extends PropertyFacetExtractor
DistinctBucketsFacetExtractor
automatically extracts buckets
based on distinct values for given properties (or node paths) in the result.Constructor and Description |
---|
DistinctValuesFacetExtractor(java.lang.String propertyRelPath,
java.lang.String valueFilter,
Predicate predicateTemplate,
java.lang.String valueParameterName)
Creates a new facet extractor with the given
valueFilter . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
Facet |
getFacet()
Called after the result set was scanned (and
FacetExtractor.handleNode(Node)
was called for each node in the result) to retrieve the final
Facet object. |
int |
hashCode() |
handleNode
public DistinctValuesFacetExtractor(java.lang.String propertyRelPath, java.lang.String valueFilter, Predicate predicateTemplate, java.lang.String valueParameterName)
valueFilter
.
The values for this facet are based on the property values referenced by
propertyRelPath
. A predicateTemplate
must be
given which for each detected bucket will be cloned and filled with the
specific value of the bucket; the value will be placed in the parameter
of the predicate given by valueParameterName
.propertyRelPath
- a relative path that points to a property. The relative path
is based on the path of the result nodes.valueFilter
- a regular expression to only select property values matching the
expression and add each matching group as one value
or null
to use the property value(s) as is.predicateTemplate
- the predicate template, which will be cloned and filled with
the specific value for each bucketvalueParameterName
- name of the parameter in the predicateTemplate
to
set with the value for the bucketpublic Facet getFacet()
FacetExtractor
FacetExtractor.handleNode(Node)
was called for each node in the result) to retrieve the final
Facet
object. Please note that this might be called without
FacetExtractor.handleNode(Node)
ever being called, if the result was empty.
Implementations can use the simple FacetImpl
implementation
of the Facet
interface.
Facet
interface with all buckets
found in the result or null
if nothing was found in
the resultpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved