Interface ITaxonomyWriterCache
ITaxonomy
It basically has Put(Facet
However, if it does so, it should clear out large parts of the cache at once,
because the user will typically need to work hard to recover from every cache
cleanup (see Put(Facet
NOTE: the cache may be accessed concurrently by multiple threads, therefore cache implementations should take this into consideration.
Inherited Members
Namespace: Lucene.Net.Facet.Taxonomy.WriterCache
Assembly: Lucene.Net.Facet.dll
Syntax
public interface ITaxonomyWriterCache : IDisposable
Properties
| Improve this Doc View SourceIsFull
Returns true if the cache is full, such that the next Put(Facet
Declaration
bool IsFull { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceClear()
Clears the content of the cache. Unlike System.
Declaration
void Clear()
Get(FacetLabel)
Lookup a category in the cache, returning its ordinal, or a negative number if the category is not in the cache.
It is up to the caller to remember what a negative response means:
If the caller knows the cache is complete (it was initially
fed with all the categories, and since then Put(Facet
Declaration
int Get(FacetLabel categoryPath)
Parameters
Type | Name | Description |
---|---|---|
Facet |
categoryPath |
Returns
Type | Description |
---|---|
System. |
Put(FacetLabel, Int32)
Add a category to the cache, with the given ordinal as the value.
If the implementation keeps only a partial cache (e.g., an LRU cache)
and finds that its cache is full, it should clear up part of the cache
and return true
. Otherwise, it should return
false
.
The reason why the caller needs to know if part of the cache was cleared is that in that case it will have to commit its on-disk index (so that all the latest category additions can be searched on disk, if we can't rely on the cache to contain them).
Ordinals should be non-negative. Currently there is no defined way to specify that a cache should remember a category does NOT exist. It doesn't really matter, because normally the next thing we do after finding that a category does not exist is to add it.
Declaration
bool Put(FacetLabel categoryPath, int ordinal)
Parameters
Type | Name | Description |
---|---|---|
Facet |
categoryPath | |
System. |
ordinal |
Returns
Type | Description |
---|---|
System. |