Class DistinctValuesFacetExtractor

  • All Implemented Interfaces:
    FacetExtractor

    public class DistinctValuesFacetExtractor
    extends PropertyFacetExtractor
    DistinctBucketsFacetExtractor automatically extracts buckets based on distinct values for given properties (or node paths) in the result.
    Since:
    5.2
    • Constructor Detail

      • DistinctValuesFacetExtractor

        public DistinctValuesFacetExtractor​(java.lang.String propertyRelPath,
                                            java.lang.String valueFilter,
                                            Predicate predicateTemplate,
                                            java.lang.String valueParameterName)
        Creates a new facet extractor with the given 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.
        Parameters:
        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 bucket
        valueParameterName - name of the parameter in the predicateTemplate to set with the value for the bucket
    • Method Detail

      • getFacet

        public Facet getFacet()
        Description copied from interface: FacetExtractor
        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. 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.

        Returns:
        an implementation of the Facet interface with all buckets found in the result or null if nothing was found in the result
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object