|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.lucene.facet.index.FacetFields
public class FacetFields
A utility class for adding facet fields to a document. Usually one field will
be added for all facets, however per the
FacetIndexingParams.getCategoryListParams(CategoryPath), one field
may be added for every group of facets.
| Field Summary | |
|---|---|
protected FacetIndexingParams |
indexingParams
|
protected TaxonomyWriter |
taxonomyWriter
|
| Constructor Summary | |
|---|---|
FacetFields(TaxonomyWriter taxonomyWriter)
Constructs a new instance with the default facet indexing params. |
|
FacetFields(TaxonomyWriter taxonomyWriter,
FacetIndexingParams params)
Constructs a new instance with the given facet indexing params. |
|
| Method Summary | |
|---|---|
protected void |
addCountingListData(Document doc,
Map<String,BytesRef> categoriesData,
String field)
Add the counting list data to the document under the given field. |
void |
addFields(Document doc,
Iterable<CategoryPath> categories)
Adds the needed facet fields to the document. |
protected Map<CategoryListParams,Iterable<CategoryPath>> |
createCategoryListMapping(Iterable<CategoryPath> categories)
Creates a mapping between a CategoryListParams and all
categories that are associated with it. |
protected FieldType |
drillDownFieldType()
Returns the FieldType with which the drill-down terms should be
indexed. |
protected Map<String,BytesRef> |
getCategoryListData(CategoryListParams categoryListParams,
IntsRef ordinals,
Iterable<CategoryPath> categories)
Returns the category list data, as a mapping from key to BytesRef
which includes the encoded data. |
protected DrillDownStream |
getDrillDownStream(Iterable<CategoryPath> categories)
Returns a DrillDownStream for writing the categories drill-down
terms. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final TaxonomyWriter taxonomyWriter
protected final FacetIndexingParams indexingParams
| Constructor Detail |
|---|
public FacetFields(TaxonomyWriter taxonomyWriter)
default facet indexing params.
taxonomyWriter - used to resolve given categories to ordinals
public FacetFields(TaxonomyWriter taxonomyWriter,
FacetIndexingParams params)
taxonomyWriter - used to resolve given categories to ordinalsparams - determines under which fields the categories should be indexed| Method Detail |
|---|
protected Map<CategoryListParams,Iterable<CategoryPath>> createCategoryListMapping(Iterable<CategoryPath> categories)
CategoryListParams and all
categories that are associated with it.
protected Map<String,BytesRef> getCategoryListData(CategoryListParams categoryListParams,
IntsRef ordinals,
Iterable<CategoryPath> categories)
throws IOException
BytesRef
which includes the encoded data. Every ordinal in ordinals
corrspond to a CategoryPath returned from categories.
IOExceptionprotected DrillDownStream getDrillDownStream(Iterable<CategoryPath> categories)
DrillDownStream for writing the categories drill-down
terms.
protected FieldType drillDownFieldType()
FieldType with which the drill-down terms should be
indexed. The default is FieldInfo.IndexOptions.DOCS_ONLY.
protected void addCountingListData(Document doc,
Map<String,BytesRef> categoriesData,
String field)
CategoryListParams.
public void addFields(Document doc,
Iterable<CategoryPath> categories)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||