test/src/kbasesearchengine/test/search/SearchTypesTest.java
@Test
    public void searchTypes_Just10TypesIndexed() throws Exception {
        int itemCount = 10;

        IndexingStorage indexStorage = createIndexingStorage(null);

        ImmutableMap.Builder<String, Integer> expectedBuilder = ImmutableMap.<String, Integer>builder();
        for (int i = 0; i < itemCount; i += 1) {
                indexOne(indexStorage, new Integer(i), true);
                expectedBuilder.put("SearchType" + i, 1);
        }
        ImmutableMap<String, Integer> expected =  expectedBuilder.build();

        final Map<String, Integer> typeCounts = indexStorage.searchTypes(
                MatchFilter.getBuilder()
                        .withNullableFullTextInAll(null)
                        .withExcludeSubObjects(true)
                        .build(),
                AccessFilter.create()
                        .withPublic(true));
        
        assertThat("inccorect type count", typeCounts.size(), is(itemCount));       
        assertThat("incorrect type summary", typeCounts, is(expected));
    }
/*
        searchTypes_Just10TypesIndexed() uses the default aggregation size, as above, but
        indexes just 10 types, which is the natural limit for ES aggregations.
        As above, this should always succeed, and is included because should, for
        some reason, the aggregation size be removed, the above test will fail,
        and this one will succeed, signaling the return of this bug.
    */
searchTypes_Just10TypesIndexed() uses the default aggregation size, as above, but
indexes just 10 types, which is the natural limit for ES aggregations.
As above, this should always succeed, and is included because should, for
some reason, the aggregation size be removed, the above test will fail,
and this one will succeed, signaling the return of this bug.
searchTypes_Just10TypesIndexed () uses the default aggregation size as above but indexes just 10 types which is the natural limit for ES aggregations . As above this should always succeed and is included because should for some reason the aggregation size be removed the above test will fail and this one will succeed signaling the return of this bug .
@Test
    public void searchTypes_Just10TypesIndexed() throws Exception {
        int itemCount = 10;
        IndexingStorage indexStorage = createIndexingStorage(null);
        ImmutableMap.Builder<String, Integer> expectedBuilder = ImmutableMap.<String, Integer>builder();
        for (int i = 0; i < itemCount; i += 1) {
                indexOne(indexStorage, new Integer(i), true);
                expectedBuilder.put("SearchType" + i, 1);
        }
        ImmutableMap<String, Integer> expected =  expectedBuilder.build();
        final Map<String, Integer> typeCounts = indexStorage.searchTypes(
                MatchFilter.getBuilder()
                        .withNullableFullTextInAll(null)
                        .withExcludeSubObjects(true)
                        .build(),
                AccessFilter.create()
                        .withPublic(true));
        assertThat("inccorect type count", typeCounts.size(), is(itemCount));       
        assertThat("incorrect type summary", typeCounts, is(expected));
    }
@ Test public void searchTypes_Just10TypesIndexed ( ) throws Exception { int itemCount = 10 ; IndexingStorage indexStorage = createIndexingStorage ( null ) ; ImmutableMap . Builder < String , Integer > expectedBuilder = ImmutableMap . < String , Integer > builder ( ) ; for ( int i = 0 ; i < itemCount ; i += 1 ) { indexOne ( indexStorage , new Integer ( i ) , true ) ; expectedBuilder . put ( "SearchType" + i , 1 ) ; } ImmutableMap < String , Integer > expected = expectedBuilder . build ( ) ; final Map < String , Integer > typeCounts = indexStorage . searchTypes ( MatchFilter . getBuilder ( ) . withNullableFullTextInAll ( null ) . withExcludeSubObjects ( true ) . build ( ) , AccessFilter . create ( ) . withPublic ( true ) ) ; assertThat ( "inccorect type count" , typeCounts . size ( ) , is ( itemCount ) ) ; assertThat ( "incorrect type summary" , typeCounts , is ( expected ) ) ; }
searchTypes_Just10TypesIndexed() uses the default aggregation size, as above, but
indexes just 10 types, which is the natural limit for ES aggregations.
searchTypes_Just10TypesIndexed () uses the default aggregation size as above but indexes just 10 types which is the natural limit for ES aggregations .