3 <title>Enhanced category features</title>
6 <h1>Enhanced category features</h1>
8 Mechanisms for addition of enhanced category features.
9 <p>A {@link org.apache.lucene.facet.enhancements.CategoryEnhancement CategoryEnhancement}
10 (which can correspond to a
11 {@link org.apache.lucene.facet.index.attributes.CategoryProperty CategoryProperty})
12 can contribute to the index in two possible ways:
14 <li>To each category with data relevant to the enhancement,
15 add this data to the category's token payload, through
16 {@link org.apache.lucene.facet.enhancements.CategoryEnhancement#getCategoryTokenBytes(CategoryAttribute) CategoryEnhancement.getCategoryTokenBytes()}.
17 This data will be read during search using
18 {@link org.apache.lucene.facet.enhancements.CategoryEnhancement#extractCategoryTokenData(byte[], int, int) CategoryEnhancement.extractCategoryTokenData()}.
20 <li>To each document which contains categories with data relevant to the enhancement, add a
21 {@link org.apache.lucene.facet.index.streaming.CategoryListTokenizer CategoryListTokenizer} through
22 {@link org.apache.lucene.facet.enhancements.CategoryEnhancement#getCategoryListTokenizer CategoryEnhancement.getCategoryListTokenizer()} .
24 {@link org.apache.lucene.facet.index.streaming.CategoryListTokenizer CategoryListTokenizer}
25 should add a single token which includes all the enhancement relevant data from the categories.
26 The category list token's text is defined by
27 {@link org.apache.lucene.facet.enhancements.CategoryEnhancement#getCategoryListTermText() CategoryEnhancement.getCategoryListTermText()}.