A utility class which allows attachment of {@link CategoryPath}s or {@link CategoryAttribute}s to a given document using a taxonomy.
Construction could be done with either a given {@link FacetIndexingParams} orthe default implementation {@link DefaultFacetIndexingParams}.
A CategoryDocumentBuilder can be reused by repeatedly setting the categories and building the document. Categories are provided either as {@link CategoryAttribute} elements through {@link #setCategories(Iterable)}, or as {@link CategoryPath} elements through{@link #setCategoryPaths(Iterable)}.
Note that both {@link #setCategories(Iterable)} and{@link #setCategoryPaths(Iterable)} return this{@link CategoryDocumentBuilder}, allowing the following pattern: {@code newCategoryDocumentBuilder(taxonomy, params).setCategories(categories).build(doc)}.
@lucene.experimental