Enhanced category features

Mechanisms for addition of enhanced category features.

A {@link org.apache.lucene.facet.enhancements.CategoryEnhancement CategoryEnhancement} (which can correspond to a {@link org.apache.lucene.facet.index.attributes.CategoryProperty CategoryProperty}) can contribute to the index in two possible ways:

  1. To each category with data relevant to the enhancement, add this data to the category's token payload, through {@link org.apache.lucene.facet.enhancements.CategoryEnhancement#getCategoryTokenBytes(CategoryAttribute) CategoryEnhancement.getCategoryTokenBytes()}. This data will be read during search using {@link org.apache.lucene.facet.enhancements.CategoryEnhancement#extractCategoryTokenData(byte[], int, int) CategoryEnhancement.extractCategoryTokenData()}.
  2. To each document which contains categories with data relevant to the enhancement, add a {@link org.apache.lucene.facet.index.streaming.CategoryListTokenizer CategoryListTokenizer} through {@link org.apache.lucene.facet.enhancements.CategoryEnhancement#getCategoryListTokenizer CategoryEnhancement.getCategoryListTokenizer()} . The {@link org.apache.lucene.facet.index.streaming.CategoryListTokenizer CategoryListTokenizer} should add a single token which includes all the enhancement relevant data from the categories. The category list token's text is defined by {@link org.apache.lucene.facet.enhancements.CategoryEnhancement#getCategoryListTermText() CategoryEnhancement.getCategoryListTermText()}.