Class DefaultPostingsFormatFactory
LUCENENET specific class that implements the default functionality for the IPostingsFormatFactory.
The most common use cases are:
- subclass DefaultPostingsFormatFactory and override GetPostingsFormat(Type) so an external dependency injection container can be used to supply the instances (lifetime should be singleton). Note that you could alternately use the "named type" feature that many DI containers have to supply the type based on name by overriding GetPostingsFormat(String).
- subclass DefaultPostingsFormatFactory and override GetPostingsFormatType(String) so a type new type can be supplied that is not in the Lucene.Net.Codecs.DefaultPostingsFormatFactory.postingsFormatNameToTypeMap.
- subclass DefaultPostingsFormatFactory to add new or override the default PostingsFormat types by overriding Initialize() and calling PutPostingsFormatType(Type).
- subclass DefaultPostingsFormatFactory to scan additional assemblies for PostingsFormat subclasses in by overriding Initialize() and calling ScanForPostingsFormats(Assembly). For performance reasons, the default behavior only loads Lucene.Net codecs.
To set the IPostingsFormatFactory, call SetPostingsFormatFactory(IPostingsFormatFactory).
Inherited Members
Assembly: DistributedLucene.Net.dll
Syntax
public class DefaultPostingsFormatFactory : NamedServiceFactory<PostingsFormat>, IPostingsFormatFactory, IServiceListable
Methods
Name | Description |
---|---|
AvailableServices() | Gets a list of the available PostingsFormats (by name). |
GetPostingsFormat(String) | Gets the PostingsFormat instance from the provided |
GetPostingsFormat(Type) | Gets the PostingsFormat instance from the provided |
GetPostingsFormatType(String) | Gets the PostingsFormat |
Initialize() | Initializes the codec type cache with the known PostingsFormat types.
Override this method (and optionally call If two types have the same name by using the PostingsFormatNameAttribute, the last one registered wins. |
PutPostingsFormatType(Type) | Adds a PostingsFormat type to the Lucene.Net.Codecs.DefaultPostingsFormatFactory.postingsFormatNameToTypeMap, using the name provided in the PostingsFormatNameAttribute, if present, or the name of the codec class minus the "Codec" suffix as the name by default. Note that if a PostingsFormat with the same name already exists in the map, calling this method will update it to the new type. |
ScanForPostingsFormats(Assembly) | Scans the given |
ScanForPostingsFormats(IEnumerable<Assembly>) | Scans the given |