Package org.apache.lucene.facet.taxonomy

Taxonomy of Categories.

Facets are defined using a hierarchy of categories, known as a Taxonomy. For example, the taxonomy of a book store application might have the following structure:

  • Author
    • Mark Twain
    • J. K. Rowling
  • Date
    • 2010
    • March
    • April
  • 2009

The Taxonomy translates category-paths into integer identifiers (often termed ordinals) and vice versa. The category Author/Mark Twain adds two nodes to the taxonomy: Author and Author/Mark Twain, each is assigned a different ordinal. The taxonomy maintains the invariant that a node always has an ordinal that is < all its children.