|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.codecs.PostingsFormat org.apache.lucene.codecs.perfield.PerFieldPostingsFormat
public abstract class PerFieldPostingsFormat
Enables per field postings support.
Note, when extending this class, the name (PostingsFormat.getName()
) is
written into the index. In order for the field to be read, the
name must resolve to your implementation via PostingsFormat.forName(String)
.
This method uses Java's
Service Provider Interface
to resolve format names.
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.
ServiceLoader
Field Summary | |
---|---|
static String |
PER_FIELD_FORMAT_KEY
FieldInfo attribute name used to store the
format name for each field. |
static String |
PER_FIELD_NAME
Name of this PostingsFormat . |
static String |
PER_FIELD_SUFFIX_KEY
FieldInfo attribute name used to store the
segment suffix name for each field. |
Fields inherited from class org.apache.lucene.codecs.PostingsFormat |
---|
EMPTY |
Constructor Summary | |
---|---|
PerFieldPostingsFormat()
Sole constructor. |
Method Summary | |
---|---|
FieldsConsumer |
fieldsConsumer(SegmentWriteState state)
Writes a new segment |
FieldsProducer |
fieldsProducer(SegmentReadState state)
Reads a segment. |
abstract PostingsFormat |
getPostingsFormatForField(String field)
Returns the postings format that should be used for writing new segments of field . |
Methods inherited from class org.apache.lucene.codecs.PostingsFormat |
---|
availablePostingsFormats, forName, getName, reloadPostingsFormats, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PER_FIELD_NAME
PostingsFormat
.
public static final String PER_FIELD_FORMAT_KEY
FieldInfo
attribute name used to store the
format name for each field.
public static final String PER_FIELD_SUFFIX_KEY
FieldInfo
attribute name used to store the
segment suffix name for each field.
Constructor Detail |
---|
public PerFieldPostingsFormat()
Method Detail |
---|
public final FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException
PostingsFormat
fieldsConsumer
in class PostingsFormat
IOException
public final FieldsProducer fieldsProducer(SegmentReadState state) throws IOException
PostingsFormat
fieldsProducer
in class PostingsFormat
IOException
public abstract PostingsFormat getPostingsFormatForField(String field)
field
.
The field to format mapping is written to the index, so this method is only invoked when writing, not when reading.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |