public class AssociationsFacetFields extends FacetFields
FacetIndexingParams.getCategoryListParams(CategoryPath)
, one field
may be added for every group of facets.indexingParams, taxonomyWriter
Constructor and Description |
---|
AssociationsFacetFields(TaxonomyWriter taxonomyWriter)
Constructs a new instance with the
default facet indexing params. |
AssociationsFacetFields(TaxonomyWriter taxonomyWriter,
FacetIndexingParams params)
Constructs a new instance with the given facet indexing params.
|
Modifier and Type | Method and Description |
---|---|
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. |
addCountingListData
public AssociationsFacetFields(TaxonomyWriter taxonomyWriter)
default
facet indexing params.taxonomyWriter
- used to resolve given categories to ordinalspublic AssociationsFacetFields(TaxonomyWriter taxonomyWriter, FacetIndexingParams params)
taxonomyWriter
- used to resolve given categories to ordinalsparams
- determines under which fields the categories should be indexedprotected Map<CategoryListParams,Iterable<CategoryPath>> createCategoryListMapping(Iterable<CategoryPath> categories)
FacetFields
CategoryListParams
and all
categories
that are associated with it.createCategoryListMapping
in class FacetFields
protected Map<String,BytesRef> getCategoryListData(CategoryListParams categoryListParams, IntsRef ordinals, Iterable<CategoryPath> categories) throws IOException
FacetFields
BytesRef
which includes the encoded data. Every ordinal in ordinals
corrspond to a CategoryPath
returned from categories
.getCategoryListData
in class FacetFields
IOException
protected DrillDownStream getDrillDownStream(Iterable<CategoryPath> categories)
FacetFields
DrillDownStream
for writing the categories drill-down
terms.getDrillDownStream
in class FacetFields
protected FieldType drillDownFieldType()
FacetFields
FieldType
with which the drill-down terms should be
indexed. The default is FieldInfo.IndexOptions.DOCS_ONLY
.drillDownFieldType
in class FacetFields
public void addFields(Document doc, Iterable<CategoryPath> categories) throws IOException
FacetFields
addFields
in class FacetFields
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.