// index documents, 50% have only 'b' and all have 'a'
for (int i = 0; i < 100; i++) {
Document doc = new Document();
CategoryContainer container = new CategoryContainer();
container.addCategory(aint, new AssociationIntProperty(2));
container.addCategory(afloat, new AssociationFloatProperty(0.5f));
if (i % 2 == 0) { // 50
container.addCategory(bint, new AssociationIntProperty(3));
container.addCategory(bfloat, new AssociationFloatProperty(0.2f));
}
builder.setCategories(container).build(doc);