Reading from the on-disk index on every method call is too slow, so this
implementation employs caching: Some methods cache recent requests and their
results, while other methods prefetch all the data into memory and then
provide answers directly from in-memory tables. See the documentation of
individual methods for comments on their performance.

WARNING: This API is experimental and might change in incompatible ways in the next release.

doOpenIfChanged

NOTE: the returned DirectoryTaxonomyReader shares the
ordinal and category caches with this reader. This is not expected to cause
any issues, unless the two instances continue to live. The reader
guarantees that the two instances cannot affect each other in terms of
correctness of the caches, however if the size of the cache is changed
through setCacheSize(int), it will affect both reader instances.

getOrdinal

Returns the ordinal of the category given as a path. The ordinal is the
category's serial number, an integer which starts with 0 and grows as more
categories are added (note that once a category is added, it can never be
deleted).

getSize

Returns the number of categories in the taxonomy. Note that the number of
categories returned is often slightly higher than the number of categories
inserted into the taxonomy; This is because when a category is added to the
taxonomy, its ancestors are also added automatically (including the root,
which always get ordinal 0).

setCacheSize

Currently, if the given size is smaller than the current size of
a cache, it will not shrink, and rather we be limited to its current
size.

Parameters:

size - the new maximum cache size, in number of entries.

setDelimiter

public void setDelimiter(char delimiter)

setDelimiter changes the character that the taxonomy uses in its
internal storage as a delimiter between category components. Do not
use this method unless you really know what you are doing.

If you do use this method, make sure you call it before any other
methods that actually queries the taxonomy. Moreover, make sure you
always pass the same delimiter for all LuceneTaxonomyWriter and
LuceneTaxonomyReader objects you create.