Package com.day.cq.search.facets
Interface FacetExtractor
- 
- All Known Implementing Classes:
 DistinctValuesFacetExtractor,PredefinedBucketsFacetExtractor,PropertyFacetExtractor
public interface FacetExtractorFacetExtractorextracts aFacetfrom a result set from aQuery. For each node in the result,handleNode(Node)will be called and the implementation should keep track of the values or ratherBuckets. After the result set was scanned,getFacet()will be called to retrieve the finalFacet.Performance Note: In order to minimize the number of
FacetExtractorsandFacets, all implementations should properly implement the#equals(Object)(and thus also#hashCode()) methods so that the framework can remove duplicateFacetExtractorsbefore scanning the result nodes. The reason is that somePredicateswill createFacetsof the same type, since they follow the same definition, but have different user-chosen values to check against. As aFacettries to find all different values present in a search result, for the same type ofPredicateEvaluatororFacet, they will return the same set of values /Buckets. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FacetgetFacet()Called after the result set was scanned (andhandleNode(Node)was called for each node in the result) to retrieve the finalFacetobject.voidhandleNode(javax.jcr.Node node)Called for each node of the result set. 
 - 
 
- 
- 
Method Detail
- 
handleNode
void handleNode(javax.jcr.Node node) throws javax.jcr.RepositoryExceptionCalled for each node of the result set.- Parameters:
 node- node in the result- Throws:
 javax.jcr.RepositoryException- if access to the node failed, ie. one of the methods on node threw an exception
 
- 
getFacet
Facet getFacet()
Called after the result set was scanned (andhandleNode(Node)was called for each node in the result) to retrieve the finalFacetobject. Please note that this might be called withouthandleNode(Node)ever being called, if the result was empty.Implementations can use the simple
FacetImplimplementation of theFacetinterface.- Returns:
 - an implementation of the 
Facetinterface with all buckets found in the result ornullif nothing was found in the result 
 
 - 
 
 -