Class PostingsFormat
Encodes/decodes terms, postings, and proximity data.
Note, when extending this class, the name (Name) may
written into the index in certain configurations. In order for the segment
to be read, the name must resolve to your implementation via For
If you implement your own format:
- Subclass this class.
- Subclass Default
Postings , override Initialize(), and add the lineFormat Factory base.ScanForPostingsFormats(typeof(YourPostingsFormat).Assembly)
. If you have any format classes in your assembly that are not meant for reading, you can add the ExcludePostings to them so they are ignored by the scan.Format From Scan Attribute - Set the new IPostings
Format by calling SetFactory Postings at application startup.Format Factory(IPostings Format Factory)
PostingsFormat Names
Unlike the Java version, format names are by default convention-based on the class name. If you name your custom format class "MyCustomPostingsFormat", the codec name will the same name without the "PostingsFormat" suffix: "MyCustom".
You can override this default behavior by using the Postings
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
Inherited Members
Namespace: Lucene.Net.Codecs
Assembly: Lucene.Net.dll
Syntax
public abstract class PostingsFormat
Constructors
| Improve this Doc View SourcePostingsFormat()
Creates a new postings format.
The provided name will be written into the index segment in some configurations
(such as when using Per
Declaration
protected PostingsFormat()
Fields
| Improve this Doc View SourceEMPTY
Zero-length Postings
Declaration
public static readonly PostingsFormat[] EMPTY
Field Value
Type | Description |
---|---|
Postings |
Properties
| Improve this Doc View SourceAvailablePostingsFormats
Returns a list of all available format names.
Declaration
public static ICollection<string> AvailablePostingsFormats { get; }
Property Value
Type | Description |
---|---|
System. |
Name
Returns this posting format's name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceFieldsConsumer(SegmentWriteState)
Writes a new segment.
Declaration
public abstract FieldsConsumer FieldsConsumer(SegmentWriteState state)
Parameters
Type | Name | Description |
---|---|---|
Segment |
state |
Returns
Type | Description |
---|---|
Fields |
FieldsProducer(SegmentReadState)
Reads a segment. NOTE: by the time this call
returns, it must hold open any files it will need to
use; else, those files may be deleted.
Additionally, required files may be deleted during the execution of
this call before there is a chance to open them. Under these
circumstances an System.
Declaration
public abstract FieldsProducer FieldsProducer(SegmentReadState state)
Parameters
Type | Name | Description |
---|---|---|
Segment |
state |
Returns
Type | Description |
---|---|
Fields |
ForName(String)
Looks up a format by name.
Declaration
public static PostingsFormat ForName(string name)
Parameters
Type | Name | Description |
---|---|---|
System. |
name |
Returns
Type | Description |
---|---|
Postings |
GetPostingsFormatFactory()
Gets the associated Postings
Declaration
public static IPostingsFormatFactory GetPostingsFormatFactory()
Returns
Type | Description |
---|---|
IPostings |
The Postings |
SetPostingsFormatFactory(IPostingsFormatFactory)
Sets the IPostings
Declaration
public static void SetPostingsFormatFactory(IPostingsFormatFactory postingsFormatFactory)
Parameters
Type | Name | Description |
---|---|---|
IPostings |
postingsFormatFactory | The new IPostings |
Exceptions
Type | Condition |
---|---|
System. |
The |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |