Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.facet.index
Class CountingListBuilder

    java.lang.Object
      org.apache.lucene.facet.index.CountingListBuilder

All Implemented Interfaces:
  CategoryListBuilder

    public class CountingListBuilder

extends Object
implements CategoryListBuilder

A `CategoryListBuilder` which builds a counting list data by encoding the category ordinals into one or more `BytesRef`. Each `BytesRef` corresponds to a set of ordinals that belong to the same partition. When partitions are not enabled (i.e. `FacetIndexingParams.getPartitionSize()` returns `Integer.MAX_VALUE`), only one `BytesRef` is 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 Summary
`CountingListBuilder(CategoryListParams categoryListParams, FacetIndexingParams indexingParams, TaxonomyWriter taxoWriter)`

Method Summary
`Map<String,BytesRef>` | `build(IntsRef ordinals, Iterable<CategoryPath> categories)` Every returned `BytesRef` corresponds to a single partition (as defined by `FacetIndexingParams.getPartitionSize()`) and the key denotes the partition ID.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CountingListBuilder

    public CountingListBuilder(CategoryListParams categoryListParams,
                               FacetIndexingParams indexingParams,
                               TaxonomyWriter taxoWriter)

Method Detail

### build

    public Map<String,BytesRef> build(IntsRef ordinals,
                                      Iterable<CategoryPath> categories)
                               throws IOException

  Every returned `BytesRef` corresponds 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.

  NOTE: the `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.

  Specified by:
    `build` in interface `CategoryListBuilder`
  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.