Show / Hide Table of Contents

    Namespace Lucene.Net.Codecs

    Codecs API: API for customization of the encoding and structure of the index.

    The Codec API allows you to customise the way the following pieces of index information are stored: * Postings lists - see PostingsFormat * DocValues - see DocValuesFormat * Stored fields - see StoredFieldsFormat * Term vectors - see TermVectorsFormat * FieldInfos - see FieldInfosFormat * SegmentInfo - see SegmentInfoFormat * Norms - see NormsFormat * Live documents - see LiveDocsFormat

    For some concrete implementations beyond Lucene's official index format, see the Codecs module.

    Codecs are identified by name through the Java Service Provider Interface. To create your own codec, extend Codec and pass the new codec's name to the super() constructor: public class MyCodec extends Codec { public MyCodec() { super("MyCodecName"); } ... } You will need to register the Codec class so that the {@link java.util.ServiceLoader ServiceLoader} can find it, by including a META-INF/services/org.apache.lucene.codecs.Codec file on your classpath that contains the package-qualified name of your codec.

    If you just want to customise the PostingsFormat, or use different postings formats for different fields, then you can register your custom postings format in the same way (in META-INF/services/org.apache.lucene.codecs.PostingsFormat), and then extend the default Lucene46Codec and override #getPostingsFormatForField(String) to return your custom postings format.

    Similarly, if you just want to customise the DocValuesFormat per-field, have a look at #getDocValuesFormatForField(String).

    Classes

    MissingOrdRemapper

    A utility class to write missing values for SORTED as if they were the empty string (to simulate pre-Lucene4.5 dv behavior for testing old codecs).

    TestCodecFactory

    LUCENENET specific class used to add the codecs from the test framework.

    TestDocValuesFormatFactory

    LUCENENET specific class used to add the DocValuesFormats from the test framework.

    TestPostingsFormatFactory

    LUCENENET specific class used to add the PostingsFormats from the test framework.

    • Improve this Doc
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)