Property | Type | Description | |
---|---|---|---|
AddCategoryDocument | int | ||
AddToCache | void | ||
CombinedCommitData | string>.IDictionary | ||
DoClose | void | ||
InitReaderManager | void | ||
InternalAddCategory | int | ||
PerhapsFillCache | void | ||
ReadCommitData | string>.IDictionary | ||
RefreshReaderManager | void |
Method | Description | |
---|---|---|
AddCategory ( FacetLabel categoryPath ) : int | ||
AddTaxonomy ( Directory taxoDir, OrdinalMap map ) : void |
Takes the categories from the given taxonomy directory, and adds the missing ones to this taxonomy. Additionally, it fills the given OrdinalMap with a mapping from the original ordinal to the new ordinal.
|
|
Commit ( ) : void | ||
DefaultTaxonomyWriterCache ( ) : TaxonomyWriterCache |
Defines the default TaxonomyWriterCache to use in constructors which do not specify one. The current default is Cl2oTaxonomyWriterCache constructed with the parameters (1024, 0.15f, 3), i.e., the entire taxonomy is cached in memory while building it.
|
|
DirectoryTaxonomyWriter ( Directory directory, OpenMode openMode = OpenMode.CREATE_OR_APPEND ) : System |
Creates a new instance with a default cache as defined by #defaultTaxonomyWriterCache().
|
|
DirectoryTaxonomyWriter ( Directory directory, OpenMode openMode, TaxonomyWriterCache cache ) : System |
Construct a Taxonomy writer.
|
|
Dispose ( ) : void |
Frees used resources as well as closes the underlying IndexWriter, which commits whatever changes made to it to the underlying Directory.
|
|
GetParent ( int ordinal ) : int | ||
PrepareCommit ( ) : void |
prepare most of the work needed for a two-phase commit. See IndexWriter#prepareCommit.
|
|
ReplaceTaxonomy ( Directory taxoDir ) : void |
Replaces the current taxonomy with the given one. This method should generally be called in conjunction with IndexWriter#addIndexes(Directory...) to replace both the taxonomy as well as the search index content.
|
|
Rollback ( ) : void |
Rollback changes to the taxonomy writer and closes the instance. Following this method the instance becomes unusable (calling any of its API methods will yield an AlreadyClosedException).
|
|
Unlock ( Directory directory ) : void |
Forcibly unlocks the taxonomy in the named directory. Caution: this should only be used by failure recovery code, when it is known that no other process nor thread is in fact currently accessing this taxonomy. This method is unnecessary if your Directory uses a NativeFSLockFactory instead of the default SimpleFSLockFactory. When the "native" lock is used, a lock does not stay behind forever when the process using it dies.
|
Method | Description | |
---|---|---|
CloseResources ( ) : void |
A hook for extending classes to close additional resources that were used. The default implementation closes the IndexReader as well as the TaxonomyWriterCache instances that were used.
|
|
CreateIndexWriterConfig ( OpenMode openMode ) : IndexWriterConfig |
Create the IndexWriterConfig that would be used for opening the internal index writer.
|
|
EnsureOpen ( ) : void |
Verifies that this instance wasn't closed, or throws AlreadyClosedException if it is.
|
|
FindCategory ( FacetLabel categoryPath ) : int |
Look up the given category in the cache and/or the on-disk storage, returning the category's ordinal, or a negative number in case the category does not yet exist in the taxonomy.
|
|
OpenIndexWriter ( Directory directory, IndexWriterConfig config ) : IndexWriter |
Open internal index writer, which contains the taxonomy data. Extensions may provide their own IndexWriter implementation or instance.
|
Method | Description | |
---|---|---|
AddCategoryDocument ( FacetLabel categoryPath, int parent ) : int |
Note that the methods calling addCategoryDocument() are synchornized, so this method is effectively synchronized as well.
|
|
AddToCache ( FacetLabel categoryPath, int id ) : void | ||
CombinedCommitData ( string>.IDictionary |
Combine original user data with the taxonomy epoch.
|
|
DoClose ( ) : void | ||
InitReaderManager ( ) : void |
Opens a ReaderManager from the internal IndexWriter.
|
|
InternalAddCategory ( FacetLabel cp ) : int |
Add a new category into the index (and the cache), and return its new ordinal. Actually, we might also need to add some of the category's ancestors before we can add the category itself (while keeping the invariant that a parent is always added to the taxonomy before its child). We do this by recursion.
|
|
PerhapsFillCache ( ) : void | ||
ReadCommitData ( Directory dir ) : string>.IDictionary |
Reads the commit data from a Directory.
|
|
RefreshReaderManager ( ) : void |
public AddCategory ( FacetLabel categoryPath ) : int | ||
categoryPath | FacetLabel | |
return | int |
public AddTaxonomy ( Directory taxoDir, OrdinalMap map ) : void | ||
taxoDir | Directory | |
map | OrdinalMap | |
return | void |
protected CreateIndexWriterConfig ( OpenMode openMode ) : IndexWriterConfig | ||
openMode | OpenMode | see |
return | IndexWriterConfig |
public static DefaultTaxonomyWriterCache ( ) : TaxonomyWriterCache | ||
return | TaxonomyWriterCache |
public DirectoryTaxonomyWriter ( Directory directory, OpenMode openMode = OpenMode.CREATE_OR_APPEND ) : System | ||
directory | Directory | |
openMode | OpenMode | |
return | System |
public DirectoryTaxonomyWriter ( Directory directory, OpenMode openMode, TaxonomyWriterCache cache ) : System | ||
directory | Directory |
/// The |
openMode | OpenMode |
/// Specifies how to open a taxonomy for writing: APPEND
/// means open an existing index for append (failing if the index does
/// not yet exist). CREATE means create a new index (first
/// deleting the old one if it already existed).
/// APPEND_OR_CREATE appends to an existing index if there
/// is one, otherwise it creates a new index. |
cache | TaxonomyWriterCache |
/// A |
return | System |
protected FindCategory ( FacetLabel categoryPath ) : int | ||
categoryPath | FacetLabel | |
return | int |
protected OpenIndexWriter ( Directory directory, IndexWriterConfig config ) : IndexWriter | ||
directory | Directory |
/// the |
config | IndexWriterConfig | /// configuration for the internal index writer. |
return | IndexWriter |
public ReplaceTaxonomy ( Directory taxoDir ) : void | ||
taxoDir | Directory | |
return | void |
public static Unlock ( Directory directory ) : void | ||
directory | Directory | |
return | void |