Class PerFieldPostingsFormat
Enables per field postings support.
Note, when extending this class, the name (Name) is written into the index. In order for the field to be read, the name must resolve to your implementation via ForName(string). This method uses GetPostingsFormat(string) to resolve format names. See DefaultPostingsFormatFactory for information about how to implement your own PostingsFormat. Files written by each posting format have an additional suffix containing the format name. For example, in a per-field configuration instead of_1.prx
filenames would look like _1_Lucene40_0.prx
.
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Codecs.PerField
Assembly: Lucene.Net.dll
Syntax
[PostingsFormatName("PerField40")]
public abstract class PerFieldPostingsFormat : PostingsFormat
Constructors
PerFieldPostingsFormat()
Sole constructor.
Declaration
protected PerFieldPostingsFormat()
See Also
Fields
PER_FIELD_FORMAT_KEY
FieldInfo attribute name used to store the format name for each field.
Declaration
public static readonly string PER_FIELD_FORMAT_KEY
Field Value
Type | Description |
---|---|
string |
See Also
PER_FIELD_SUFFIX_KEY
FieldInfo attribute name used to store the segment suffix name for each field.
Declaration
public static readonly string PER_FIELD_SUFFIX_KEY
Field Value
Type | Description |
---|---|
string |
See Also
Methods
FieldsConsumer(SegmentWriteState)
Writes a new segment.
Declaration
public override sealed FieldsConsumer FieldsConsumer(SegmentWriteState state)
Parameters
Type | Name | Description |
---|---|---|
SegmentWriteState | state |
Returns
Type | Description |
---|---|
FieldsConsumer |
Overrides
See Also
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 IOException should be thrown by the implementation. IOExceptions are expected and will automatically cause a retry of the segment opening logic with the newly revised segments.
Declaration
public override sealed FieldsProducer FieldsProducer(SegmentReadState state)
Parameters
Type | Name | Description |
---|---|---|
SegmentReadState | state |
Returns
Type | Description |
---|---|
FieldsProducer |
Overrides
See Also
GetPostingsFormatForField(string)
Returns the postings format that should be used for writing
new segments of field
.
Declaration
public abstract PostingsFormat GetPostingsFormatForField(string field)
Parameters
Type | Name | Description |
---|---|---|
string | field |
Returns
Type | Description |
---|---|
PostingsFormat |