}
// we do not alter indexing parameters!
// a category document builder will add the categories to a document
// once build() is called
CategoryDocumentBuilder categoryDocBuilder = new EnhancementsDocumentBuilder(
taxo, AssociationUtils.assocIndexingParams);
categoryDocBuilder.setCategories(categoryContainer);
// create a plain Lucene document and add some regular Lucene fields
// to it
Document doc = new Document();
doc.add(new Field(SimpleUtils.TITLE, SimpleUtils.docTitles[docNum],
Store.YES, Index.ANALYZED));
doc.add(new Field(SimpleUtils.TEXT, SimpleUtils.docTexts[docNum],
Store.NO, Index.ANALYZED));
// invoke the category document builder for adding categories to the
// document and,
// as required, to the taxonomy index
categoryDocBuilder.build(doc);
// finally add the document to the index
iw.addDocument(doc);
nDocsAdded++;