public interface FacetExtractor
FacetExtractor
extracts a Facet
from a result set from a
Query
. For each node in the result, handleNode(Node)
will be
called and the implementation should keep track of the values or rather
Buckets
. After the result set was scanned, getFacet()
will be called to retrieve the final Facet
.
Performance Note: In order to minimize the number of
FacetExtractors
and Facets
, all implementations
should properly implement the #equals(Object)
(and thus also
#hashCode()
) methods so that the framework can remove duplicate
FacetExtractors
before scanning the result nodes. The reason is
that some Predicates
will create Facets
of the
same type, since they follow the same definition, but have different
user-chosen values to check against. As a Facet
tries to find
all different values present in a search result, for the same type of
PredicateEvaluator
or Facet
, they will return the same set
of values / Buckets
.
Modifier and Type | Method and Description |
---|---|
Facet |
getFacet()
Called after the result set was scanned (and
handleNode(Node)
was called for each node in the result) to retrieve the final
Facet object. |
void |
handleNode(Node node)
Called for each node of the result set.
|
void handleNode(Node node) throws RepositoryException
node
- node in the resultRepositoryException
- if access to the node failed, ie. one of the methods on node
threw an exceptionFacet getFacet()
handleNode(Node)
was called for each node in the result) to retrieve the final
Facet
object. Please note that this might be called without
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 resultCopyright © 2010 - 2020 Adobe. All Rights Reserved