Aggregate { public List<? extends Include> getIncludes() { return includes; } Aggregate(String nodeTypeName);  Aggregate(String nodeTypeName, List<? extends Include> includes);   Aggregate(String nodeTypeName, List<? extends Include> includes,
              int recursionLimit); List<? extends Include> getIncludes(); void collectAggregates(NodeState root, ResultCollector collector); List<Matcher> createMatchers(AggregateRoot root); boolean hasRelativeNodeInclude(String nodePath); boolean hasNodeAggregates(); @Override String toString(); static final String MATCH_ALL; static final int RECURSIVE_AGGREGATION_LIMIT_DEFAULT; final int reAggregationLimit; }
@Test public void simpleAggregateConfig() throws Exception{ NodeBuilder aggregates = builder.child(FulltextIndexConstants.AGGREGATES); NodeBuilder aggFolder = aggregates.child("nt:folder"); aggFolder.child("i1").setProperty(FulltextIndexConstants.AGG_PATH, "*"); IndexDefinition defn = new IndexDefinition(root, builder.getNodeState(), "/foo"); Aggregate agg = defn.getAggregate("nt:folder"); assertNotNull(agg); assertEquals(1, agg.getIncludes().size()); }
@Test public void aggregateConfig2() throws Exception{ NodeBuilder aggregates = builder.child(FulltextIndexConstants.AGGREGATES); NodeBuilder aggFolder = aggregates.child("nt:folder"); aggFolder.setProperty(FulltextIndexConstants.AGG_RECURSIVE_LIMIT, 42); aggFolder.child("i1").setProperty(FulltextIndexConstants.AGG_PATH, "*"); aggFolder.child("i1").setProperty(FulltextIndexConstants.AGG_PRIMARY_TYPE, "nt:file"); aggFolder.child("i1").setProperty(FulltextIndexConstants.AGG_RELATIVE_NODE, true); IndexDefinition defn = new IndexDefinition(root, builder.getNodeState(), "/foo"); Aggregate agg = defn.getAggregate("nt:folder"); assertNotNull(agg); assertEquals(42, agg.reAggregationLimit); assertEquals(1, agg.getIncludes().size()); assertEquals("nt:file", ((NodeInclude)agg.getIncludes().get(0)).primaryType); assertTrue(((NodeInclude)agg.getIncludes().get(0)).relativeNode); }