public class CountingListBuilder extends Object implements CategoryListBuilder
CategoryListBuilderwhich builds a counting list data by encoding the category ordinals into one or more
BytesRefcorresponds to a set of ordinals that belong to the same partition. When partitions are not enabled (i.e.
Integer.MAX_VALUE), only one
BytesRefis returned by this class.
Counting lists are used usually for computing the weight of categories by summing their number of occurrences (hence counting) in a result set.
|Constructor and Description|
public Map<String,BytesRef> build(IntsRef ordinals, Iterable<CategoryPath> categories) throws IOException
BytesRefcorresponds to a single partition (as defined by
FacetIndexingParams.getPartitionSize()) and the key denotes the partition ID. When no partitions are defined, the returned map contains only one value.
ordinals array is modified by adding parent
ordinals to it. Also, some encoders may sort the array and remove duplicate
ordinals. Therefore you may want to invoke this method after you finished
processing the array for other purposes.
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.