| <!DOCTYPE html> |
| <!--[if IE]><![endif]--> |
| <html> |
| |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| <title>Namespace Lucene.Net.Codecs |
| | Apache Lucene.NET 4.8.0 Documentation </title> |
| <meta name="viewport" content="width=device-width"> |
| <meta name="title" content="Namespace Lucene.Net.Codecs |
| | Apache Lucene.NET 4.8.0 Documentation "> |
| <meta name="generator" content="docfx 2.47.0.0"> |
| |
| <link rel="shortcut icon" href="../../logo/favicon.ico"> |
| <link rel="stylesheet" href="../../styles/docfx.vendor.css"> |
| <link rel="stylesheet" href="../../styles/docfx.css"> |
| <link rel="stylesheet" href="../../styles/main.css"> |
| <meta property="docfx:navrel" content="../../toc.html"> |
| <meta property="docfx:tocrel" content="../toc.html"> |
| |
| <meta property="docfx:rel" content="../../"> |
| |
| </head> |
| <body data-spy="scroll" data-target="#affix" data-offset="120"> |
| <div id="wrapper"> |
| <header> |
| |
| <nav id="autocollapse" class="navbar ng-scope" role="navigation"> |
| <div class="container"> |
| <div class="navbar-header"> |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| |
| <a class="navbar-brand" href="../../index.html"> |
| <img id="logo" class="svg" src="../../logo/lucene-net-color.png" alt=""> |
| </a> |
| </div> |
| <div class="collapse navbar-collapse" id="navbar"> |
| <form class="navbar-form navbar-right" role="search" id="search"> |
| <div class="form-group"> |
| <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> |
| </div> |
| </form> |
| </div> |
| </div> |
| </nav> |
| |
| <div class="subnav navbar navbar-default"> |
| <div class="container hide-when-search" id="breadcrumb"> |
| <ul class="breadcrumb"> |
| <li></li> |
| </ul> |
| </div> |
| </div> |
| </header> |
| <div class="container body-content"> |
| |
| <div id="search-results"> |
| <div class="search-list"></div> |
| <div class="sr-items"> |
| <p><i class="glyphicon glyphicon-refresh index-loading"></i></p> |
| </div> |
| <ul id="pagination"></ul> |
| </div> |
| </div> |
| <div role="main" class="container body-content hide-when-search"> |
| |
| <div class="sidenav hide-when-search"> |
| <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a> |
| <div class="sidetoggle collapse" id="sidetoggle"> |
| <div id="sidetoc"></div> |
| </div> |
| </div> |
| <div class="article row grid-right"> |
| <div class="col-md-10"> |
| <article class="content wrap" id="_content" data-uid="Lucene.Net.Codecs"> |
| |
| <h1 id="Lucene_Net_Codecs" data-uid="Lucene.Net.Codecs" class="text-break">Namespace Lucene.Net.Codecs |
| </h1> |
| <div class="markdown level0 summary"><!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <p>Codecs for testing (simulate old disk formats, wacky theoretical use cases, etc)</p> |
| </div> |
| <div class="markdown level0 conceptual"></div> |
| <div class="markdown level0 remarks"></div> |
| <h3 id="classes">Classes |
| </h3> |
| <h4><a class="xref" href="Lucene.Net.Codecs.BlockTermState.html">BlockTermState</a></h4> |
| <section><p>Holds all state required for <a class="xref" href="Lucene.Net.Codecs.PostingsReaderBase.html">PostingsReaderBase</a> |
| to produce a <a class="xref" href="Lucene.Net.Index.DocsEnum.html">DocsEnum</a> without re-seeking the |
| terms dict.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsReader.html">BlockTreeTermsReader</a></h4> |
| <section><p>A block-based terms index and dictionary that assigns |
| terms to variable length blocks according to how they |
| share prefixes. The terms index is a prefix trie |
| whose leaves are term blocks. The advantage of this |
| approach is that SeekExact() is often able to |
| determine a term cannot exist without doing any IO, and |
| intersection with Automata is very fast. Note that this |
| terms dictionary has it's own fixed terms index (ie, it |
| does not support a pluggable terms index |
| implementation).</p> |
| <p><strong>NOTE</strong>: this terms dictionary does not support |
| index divisor when opening an IndexReader. Instead, you |
| can change the min/maxItemsPerBlock during indexing.</p> |
| |
| <p>The data structure used by this implementation is very |
| similar to a burst trie |
| (<a href="http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.18.3499">http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.18.3499</a>), |
| but with added logic to break up too-large blocks of all |
| terms sharing a given prefix into smaller ones.</p> |
| |
| <p>Use <a class="xref" href="Lucene.Net.Index.CheckIndex.html">CheckIndex</a> with the <code>-verbose</code> |
| option to see summary statistics on the blocks in the |
| dictionary.</p> |
| |
| <p>See <a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsWriter.html">BlockTreeTermsWriter</a>. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsReader.FieldReader.html">BlockTreeTermsReader.FieldReader</a></h4> |
| <section><p>BlockTree's implementation of <a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsReader.html#Lucene_Net_Codecs_BlockTreeTermsReader_GetTerms_System_String_">GetTerms(String)</a>. </p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsReader.Stats.html">BlockTreeTermsReader.Stats</a></h4> |
| <section><p>BlockTree statistics for a single field |
| returned by <a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsReader.FieldReader.html#Lucene_Net_Codecs_BlockTreeTermsReader_FieldReader_ComputeStats">ComputeStats()</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsWriter.html">BlockTreeTermsWriter</a></h4> |
| <section><p>Block-based terms index and dictionary writer. |
| <p> |
| Writes terms dict and index, block-encoding (column |
| stride) each term's metadata for each set of terms |
| between two index terms. |
| <p> |
| Files: |
| <ul><li>.tim:<a href="#Termdictionary">Term Dictionary</a></li><li>.tip:<a href="#Termindex">Term Index</a></li></ul> |
| <p> |
| <a name="Termdictionary" id="Termdictionary"></a> |
| <h3>Term Dictionary</h3></p> |
| <p>The .tim file contains the list of terms in each |
| field along with per-term statistics (such as docfreq) |
| and per-term metadata (typically pointers to the postings list |
| for that term in the inverted index). |
| </p> |
| |
| <p>The .tim is arranged in blocks: with blocks containing |
| a variable number of entries (by default 25-48), where |
| each entry is either a term or a reference to a |
| sub-block.</p> |
| |
| <p>NOTE: The term dictionary can plug into different postings implementations: |
| the postings writer/reader are actually responsible for encoding |
| and decoding the Postings Metadata and Term Metadata sections.</p> |
| |
| <p><ul><li>TermsDict (.tim) --> Header, <em>PostingsHeader</em>, NodeBlock<sup>NumBlocks</sup>, |
| FieldSummary, DirOffset, Footer</li><li>NodeBlock --> (OuterNode | InnerNode)</li><li>OuterNode --> EntryCount, SuffixLength, Byte<sup>SuffixLength</sup>, StatsLength, < TermStats ><sup>EntryCount</sup>, MetaLength, <<em>TermMetadata</em>><sup>EntryCount</sup></li><li>InnerNode --> EntryCount, SuffixLength[,Sub?], Byte<sup>SuffixLength</sup>, StatsLength, < TermStats ? ><sup>EntryCount</sup>, MetaLength, <<em>TermMetadata ? </em>><sup>EntryCount</sup></li><li>TermStats --> DocFreq, TotalTermFreq </li><li>FieldSummary --> NumFields, <FieldNumber, NumTerms, RootCodeLength, Byte<sup>RootCodeLength</sup>, |
| SumTotalTermFreq?, SumDocFreq, DocCount><sup>NumFields</sup></li><li>Header --> CodecHeader (<a class="xref" href="Lucene.Net.Codecs.CodecUtil.html#Lucene_Net_Codecs_CodecUtil_WriteHeader_Lucene_Net_Store_DataOutput_System_String_System_Int32_">WriteHeader(DataOutput, String, Int32)</a></li><li>DirOffset --> Uint64 (<a class="xref" href="Lucene.Net.Store.DataOutput.html#Lucene_Net_Store_DataOutput_WriteInt64_System_Int64_">WriteInt64(Int64)</a>)</li><li>EntryCount,SuffixLength,StatsLength,DocFreq,MetaLength,NumFields, |
| FieldNumber,RootCodeLength,DocCount --> VInt (<a class="xref" href="Lucene.Net.Store.DataOutput.html#Lucene_Net_Store_DataOutput_WriteVInt32_System_Int32_">WriteVInt32(Int32)</a>_</li><li>TotalTermFreq,NumTerms,SumTotalTermFreq,SumDocFreq --> |
| VLong (<a class="xref" href="Lucene.Net.Store.DataOutput.html#Lucene_Net_Store_DataOutput_WriteVInt64_System_Int64_">WriteVInt64(Int64)</a>)</li><li>Footer --> CodecFooter (<a class="xref" href="Lucene.Net.Codecs.CodecUtil.html#Lucene_Net_Codecs_CodecUtil_WriteFooter_Lucene_Net_Store_IndexOutput_">WriteFooter(IndexOutput)</a>)</li></ul> |
| <p>Notes:</p> |
| <ul><li>Header is a CodecHeader (<a class="xref" href="Lucene.Net.Codecs.CodecUtil.html#Lucene_Net_Codecs_CodecUtil_WriteHeader_Lucene_Net_Store_DataOutput_System_String_System_Int32_">WriteHeader(DataOutput, String, Int32)</a>) storing the version information |
| for the BlockTree implementation.</li><li>DirOffset is a pointer to the FieldSummary section.</li><li>DocFreq is the count of documents which contain the term.</li><li>TotalTermFreq is the total number of occurrences of the term. this is encoded |
| as the difference between the total number of occurrences and the DocFreq.</li><li>FieldNumber is the fields number from <span class="xref">Lucene.Net.Codecs.BlockTreeTermsWriter.fieldInfos</span>. (.fnm)</li><li>NumTerms is the number of unique terms for the field.</li><li>RootCode points to the root block for the field.</li><li>SumDocFreq is the total number of postings, the number of term-document pairs across |
| the entire field.</li><li>DocCount is the number of documents that have at least one posting for this field.</li><li>PostingsHeader and TermMetadata are plugged into by the specific postings implementation: |
| these contain arbitrary per-file data (such as parameters or versioning information) |
| and per-term data (such as pointers to inverted files).</li><li>For inner nodes of the tree, every entry will steal one bit to mark whether it points |
| to child nodes(sub-block). If so, the corresponding <a class="xref" href="Lucene.Net.Codecs.TermStats.html">TermStats</a> and TermMetadata are omitted </li></ul> |
| <a name="Termindex" id="Termindex"></a> |
| <h3>Term Index</h3> |
| <p>The .tip file contains an index into the term dictionary, so that it can be |
| accessed randomly. The index is also used to determine |
| when a given term cannot exist on disk (in the .tim file), saving a disk seek.</p> |
| <ul><li>TermsIndex (.tip) --> Header, FSTIndex<sup>NumFields</sup> |
| <IndexStartFP><sup>NumFields</sup>, DirOffset, Footer</li><li>Header --> CodecHeader (<a class="xref" href="Lucene.Net.Codecs.CodecUtil.html#Lucene_Net_Codecs_CodecUtil_WriteHeader_Lucene_Net_Store_DataOutput_System_String_System_Int32_">WriteHeader(DataOutput, String, Int32)</a>)</li><li>DirOffset --> Uint64 (<a class="xref" href="Lucene.Net.Store.DataOutput.html#Lucene_Net_Store_DataOutput_WriteInt64_System_Int64_">WriteInt64(Int64)</a></li><li>IndexStartFP --> VLong (<a class="xref" href="Lucene.Net.Store.DataOutput.html#Lucene_Net_Store_DataOutput_WriteVInt64_System_Int64_">WriteVInt64(Int64)</a></li><li>FSTIndex --> <span class="xref">FST{byte[]}</span></li><li>Footer --> CodecFooter (<a class="xref" href="Lucene.Net.Codecs.CodecUtil.html#Lucene_Net_Codecs_CodecUtil_WriteFooter_Lucene_Net_Store_IndexOutput_">WriteFooter(IndexOutput)</a></li></ul> |
| <p>Notes:</p> |
| <ul><li>The .tip file contains a separate FST for each |
| field. The FST maps a term prefix to the on-disk |
| block that holds all terms starting with that |
| prefix. Each field's IndexStartFP points to its |
| FST.</li><li>DirOffset is a pointer to the start of the IndexStartFPs |
| for all fields</li><li>It's possible that an on-disk block would contain |
| too many terms (more than the allowed maximum |
| (default: 48)). When this happens, the block is |
| sub-divided into new blocks (called "floor |
| blocks"), and then the output in the FST for the |
| block's prefix encodes the leading byte of each |
| sub-block, and its file pointer.</li></ul> |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a></h4> |
| <section><p>Encodes/decodes an inverted index segment. |
| <p> |
| Note, when extending this class, the name (<a class="xref" href="Lucene.Net.Codecs.Codec.html#Lucene_Net_Codecs_Codec_Name">Name</a>) is |
| written into the index. In order for the segment to be read, the |
| name must resolve to your implementation via <a class="xref" href="Lucene.Net.Codecs.Codec.html#Lucene_Net_Codecs_Codec_ForName_System_String_">ForName(String)</a>. |
| This method uses <a class="xref" href="Lucene.Net.Codecs.ICodecFactory.html#Lucene_Net_Codecs_ICodecFactory_GetCodec_System_String_">GetCodec(String)</a> to resolve codec names. |
| <p> |
| To implement your own codec: |
| <ol><li>Subclass this class.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a>, override the <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_Initialize">Initialize()</a> method, |
| and add the line <code>base.ScanForCodecs(typeof(YourCodec).GetTypeInfo().Assembly)</code>. |
| If you have any codec classes in your assembly |
| that are not meant for reading, you can add the <a class="xref" href="Lucene.Net.Codecs.ExcludeCodecFromScanAttribute.html">ExcludeCodecFromScanAttribute</a> |
| to them so they are ignored by the scan.</li><li>set the new <a class="xref" href="Lucene.Net.Codecs.ICodecFactory.html">ICodecFactory</a> by calling <a class="xref" href="Lucene.Net.Codecs.Codec.html#Lucene_Net_Codecs_Codec_SetCodecFactory_Lucene_Net_Codecs_ICodecFactory_">SetCodecFactory(ICodecFactory)</a> at application startup.</li></ol> |
| If your codec has dependencies, you may also override <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_GetCodec_System_Type_">GetCodec(Type)</a> to inject |
| them via pure DI or a DI container. See <a href="http://blog.ploeh.dk/2014/05/19/di-friendly-framework/">DI-Friendly Framework</a> |
| to understand the approach used. |
| <p> |
| <strong>Codec Names</strong> |
| <p> |
| Unlike the Java version, codec names are by default convention-based on the class name. |
| If you name your custom codec class "MyCustomCodec", the codec name will the same name |
| without the "Codec" suffix: "MyCustom". |
| <p> |
| You can override this default behavior by using the <a class="xref" href="Lucene.Net.Codecs.CodecNameAttribute.html">CodecNameAttribute</a> to |
| name the codec differently than this convention. Codec names must be all ASCII alphanumeric, |
| and less than 128 characters in length.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.CodecNameAttribute.html">CodecNameAttribute</a></h4> |
| <section><p>Represents an attribute that is used to name a <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a>, if a name |
| other than the default <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a> naming convention is desired.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.CodecUtil.html">CodecUtil</a></h4> |
| <section><p>Utility class for reading and writing versioned headers. |
| <p> |
| Writing codec headers is useful to ensure that a file is in |
| the format you think it is. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a></h4> |
| <section><p>LUCENENET specific class that implements the default functionality for the |
| <a class="xref" href="Lucene.Net.Codecs.ICodecFactory.html">ICodecFactory</a>. |
| <p> |
| The most common use cases are: |
| <ul><li>Initialize <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a> with a set of <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_CustomCodecTypes">CustomCodecTypes</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a> and override |
| <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_GetCodec_System_Type_">GetCodec(Type)</a> 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 <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_GetCodec_System_String_">GetCodec(String)</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a> and override |
| <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_GetCodecType_System_String_">GetCodecType(String)</a> so a type new type can be |
| supplied that is not in the <span class="xref">Lucene.Net.Codecs.DefaultCodecFactory.codecNameToTypeMap</span>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a> to add new or override the default <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a> |
| types by overriding <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_Initialize">Initialize()</a> and calling <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_PutCodecType_System_Type_">PutCodecType(Type)</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a> to scan additional assemblies for <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a> |
| subclasses in by overriding <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_Initialize">Initialize()</a> and calling <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_ScanForCodecs_System_Reflection_Assembly_">ScanForCodecs(Assembly)</a>. |
| For performance reasons, the default behavior only loads Lucene.Net codecs.</li></ul> |
| <p> |
| To set the <a class="xref" href="Lucene.Net.Codecs.ICodecFactory.html">ICodecFactory</a>, call <a class="xref" href="Lucene.Net.Codecs.Codec.html#Lucene_Net_Codecs_Codec_SetCodecFactory_Lucene_Net_Codecs_ICodecFactory_">SetCodecFactory(ICodecFactory)</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html">DefaultDocValuesFormatFactory</a></h4> |
| <section><p>LUCENENET specific class that implements the default functionality for the |
| <a class="xref" href="Lucene.Net.Codecs.IDocValuesFormatFactory.html">IDocValuesFormatFactory</a>. |
| <p> |
| The most common use cases are: |
| <ul><li>Initialize <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html">DefaultDocValuesFormatFactory</a> with a set of <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_CustomDocValuesFormatTypes">CustomDocValuesFormatTypes</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html">DefaultDocValuesFormatFactory</a> and override |
| <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_GetDocValuesFormat_System_Type_">GetDocValuesFormat(Type)</a> 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 <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_GetDocValuesFormat_System_String_">GetDocValuesFormat(String)</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html">DefaultDocValuesFormatFactory</a> and override |
| <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_GetDocValuesFormatType_System_String_">GetDocValuesFormatType(String)</a> so a type new type can be |
| supplied that is not in the <span class="xref">Lucene.Net.Codecs.DefaultDocValuesFormatFactory.docValuesFormatNameToTypeMap</span>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html">DefaultDocValuesFormatFactory</a> to add new or override the default <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html">DocValuesFormat</a> |
| types by overriding <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_Initialize">Initialize()</a> and calling <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_PutDocValuesFormatType_System_Type_">PutDocValuesFormatType(Type)</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html">DefaultDocValuesFormatFactory</a> to scan additional assemblies for <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html">DocValuesFormat</a> |
| subclasses in by overriding <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_Initialize">Initialize()</a> and calling <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_ScanForDocValuesFormats_System_Reflection_Assembly_">ScanForDocValuesFormats(Assembly)</a>. |
| For performance reasons, the default behavior only loads Lucene.Net codecs.</li></ul> |
| <p> |
| To set the <a class="xref" href="Lucene.Net.Codecs.IDocValuesFormatFactory.html">IDocValuesFormatFactory</a>, call <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html#Lucene_Net_Codecs_DocValuesFormat_SetDocValuesFormatFactory_Lucene_Net_Codecs_IDocValuesFormatFactory_">SetDocValuesFormatFactory(IDocValuesFormatFactory)</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html">DefaultPostingsFormatFactory</a></h4> |
| <section><p>LUCENENET specific class that implements the default functionality for the |
| <a class="xref" href="Lucene.Net.Codecs.IPostingsFormatFactory.html">IPostingsFormatFactory</a>. |
| <p> |
| The most common use cases are: |
| <ul><li>Initialize <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html">DefaultPostingsFormatFactory</a> with a set of <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_CustomPostingsFormatTypes">CustomPostingsFormatTypes</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html">DefaultPostingsFormatFactory</a> and override |
| <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_GetPostingsFormat_System_Type_">GetPostingsFormat(Type)</a> 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 <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_GetPostingsFormat_System_String_">GetPostingsFormat(String)</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html">DefaultPostingsFormatFactory</a> and override |
| <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_GetPostingsFormatType_System_String_">GetPostingsFormatType(String)</a> so a type new type can be |
| supplied that is not in the <span class="xref">Lucene.Net.Codecs.DefaultPostingsFormatFactory.postingsFormatNameToTypeMap</span>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html">DefaultPostingsFormatFactory</a> to add new or override the default <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html">PostingsFormat</a> |
| types by overriding <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_Initialize">Initialize()</a> and calling <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_PutPostingsFormatType_System_Type_">PutPostingsFormatType(Type)</a>.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html">DefaultPostingsFormatFactory</a> to scan additional assemblies for <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html">PostingsFormat</a> |
| subclasses in by overriding <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_Initialize">Initialize()</a> and calling <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_ScanForPostingsFormats_System_Reflection_Assembly_">ScanForPostingsFormats(Assembly)</a>. |
| For performance reasons, the default behavior only loads Lucene.Net codecs.</li></ul> |
| <p> |
| To set the <a class="xref" href="Lucene.Net.Codecs.IPostingsFormatFactory.html">IPostingsFormatFactory</a>, call <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html#Lucene_Net_Codecs_PostingsFormat_SetPostingsFormatFactory_Lucene_Net_Codecs_IPostingsFormatFactory_">SetPostingsFormatFactory(IPostingsFormatFactory)</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.DocValuesConsumer.html">DocValuesConsumer</a></h4> |
| <section><p>Abstract API that consumes numeric, binary and |
| sorted docvalues. Concrete implementations of this |
| actually do "something" with the docvalues (write it into |
| the index in a specific format). |
| <p> |
| The lifecycle is: |
| <ol><li>DocValuesConsumer is created by |
| <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html#Lucene_Net_Codecs_DocValuesFormat_FieldsConsumer_Lucene_Net_Index_SegmentWriteState_">FieldsConsumer(SegmentWriteState)</a> or |
| <a class="xref" href="Lucene.Net.Codecs.NormsFormat.html#Lucene_Net_Codecs_NormsFormat_NormsConsumer_Lucene_Net_Index_SegmentWriteState_">NormsConsumer(SegmentWriteState)</a>.</li><li><a class="xref" href="Lucene.Net.Codecs.DocValuesConsumer.html#Lucene_Net_Codecs_DocValuesConsumer_AddNumericField_Lucene_Net_Index_FieldInfo_System_Collections_Generic_IEnumerable_System_Nullable_System_Int64___">AddNumericField(FieldInfo, IEnumerable<Nullable<Int64>>)</a>, |
| <a class="xref" href="Lucene.Net.Codecs.DocValuesConsumer.html#Lucene_Net_Codecs_DocValuesConsumer_AddBinaryField_Lucene_Net_Index_FieldInfo_System_Collections_Generic_IEnumerable_Lucene_Net_Util_BytesRef__">AddBinaryField(FieldInfo, IEnumerable<BytesRef>)</a>, |
| or <a class="xref" href="Lucene.Net.Codecs.DocValuesConsumer.html#Lucene_Net_Codecs_DocValuesConsumer_AddSortedField_Lucene_Net_Index_FieldInfo_System_Collections_Generic_IEnumerable_Lucene_Net_Util_BytesRef__System_Collections_Generic_IEnumerable_System_Nullable_System_Int64___">AddSortedField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<Nullable<Int64>>)</a> are called for each Numeric, |
| Binary, or Sorted docvalues field. The API is a "pull" rather |
| than "push", and the implementation is free to iterate over the |
| values multiple times (<span class="xref">System.Collections.Generic.IEnumerable<T>.GetEnumerator()</span>).</li><li>After all fields are added, the consumer is <a class="xref" href="Lucene.Net.Codecs.DocValuesConsumer.html#Lucene_Net_Codecs_DocValuesConsumer_Dispose">Dispose()</a>d.</li></ol> |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html">DocValuesFormat</a></h4> |
| <section><p>Encodes/decodes per-document values. |
| <p> |
| Note, when extending this class, the name (<a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html#Lucene_Net_Codecs_DocValuesFormat_Name">Name</a>) may |
| written into the index in certain configurations. In order for the segment |
| to be read, the name must resolve to your implementation via <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html#Lucene_Net_Codecs_DocValuesFormat_ForName_System_String_">ForName(String)</a>. |
| This method uses <a class="xref" href="Lucene.Net.Codecs.IDocValuesFormatFactory.html#Lucene_Net_Codecs_IDocValuesFormatFactory_GetDocValuesFormat_System_String_">GetDocValuesFormat(String)</a> to resolve format names. |
| <p> |
| To implement your own format: |
| <ol><li>Subclass this class.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html">DefaultDocValuesFormatFactory</a>, override the <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_Initialize">Initialize()</a> method, |
| and add the line <code>base.ScanForDocValuesFormats(typeof(YourDocValuesFormat).GetTypeInfo().Assembly)</code>. |
| If you have any format classes in your assembly |
| that are not meant for reading, you can add the <a class="xref" href="Lucene.Net.Codecs.ExcludeDocValuesFormatFromScanAttribute.html">ExcludeDocValuesFormatFromScanAttribute</a> |
| to them so they are ignored by the scan.</li><li>Set the new <a class="xref" href="Lucene.Net.Codecs.IDocValuesFormatFactory.html">IDocValuesFormatFactory</a> by calling <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html#Lucene_Net_Codecs_DocValuesFormat_SetDocValuesFormatFactory_Lucene_Net_Codecs_IDocValuesFormatFactory_">SetDocValuesFormatFactory(IDocValuesFormatFactory)</a> |
| at application startup.</li></ol> |
| If your format has dependencies, you may also override <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_GetDocValuesFormat_System_Type_">GetDocValuesFormat(Type)</a> |
| to inject them via pure DI or a DI container. See <a href="http://blog.ploeh.dk/2014/05/19/di-friendly-framework/">DI-Friendly Framework</a> |
| to understand the approach used. |
| <p> |
| <strong>DocValuesFormat Names</strong> |
| <p> |
| Unlike the Java version, format names are by default convention-based on the class name. |
| If you name your custom format class "MyCustomDocValuesFormat", the format name will the same name |
| without the "DocValuesFormat" suffix: "MyCustom". |
| <p> |
| You can override this default behavior by using the <a class="xref" href="Lucene.Net.Codecs.DocValuesFormatNameAttribute.html">DocValuesFormatNameAttribute</a> to |
| name the format differently than this convention. Format names must be all ASCII alphanumeric, |
| and less than 128 characters in length. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.DocValuesFormatNameAttribute.html">DocValuesFormatNameAttribute</a></h4> |
| <section><p>Represents an attribute that is used to name a <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html">DocValuesFormat</a>, if a name |
| other than the default <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html">DocValuesFormat</a> naming convention is desired.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.DocValuesProducer.html">DocValuesProducer</a></h4> |
| <section><p>Abstract API that produces numeric, binary and |
| sorted docvalues. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.ExcludeCodecFromScanAttribute.html">ExcludeCodecFromScanAttribute</a></h4> |
| <section><p>When placed on a class that subclasses <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a>, adding this |
| attribute will exclude the type from consideration in the |
| <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_ScanForCodecs_System_Reflection_Assembly_">ScanForCodecs(Assembly)</a> method. |
| <p> |
| However, the <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a> type can still be added manually using |
| <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html#Lucene_Net_Codecs_DefaultCodecFactory_PutCodecType_System_Type_">PutCodecType(Type)</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.ExcludeDocValuesFormatFromScanAttribute.html">ExcludeDocValuesFormatFromScanAttribute</a></h4> |
| <section><p>When placed on a class that subclasses <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html">DocValuesFormat</a>, adding this |
| attribute will exclude the type from consideration in the |
| <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_ScanForDocValuesFormats_System_Reflection_Assembly_">ScanForDocValuesFormats(Assembly)</a> method. |
| <p> |
| However, the <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html">DocValuesFormat</a> type can still be added manually using |
| <a class="xref" href="Lucene.Net.Codecs.DefaultDocValuesFormatFactory.html#Lucene_Net_Codecs_DefaultDocValuesFormatFactory_PutDocValuesFormatType_System_Type_">PutDocValuesFormatType(Type)</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.ExcludePostingsFormatFromScanAttribute.html">ExcludePostingsFormatFromScanAttribute</a></h4> |
| <section><p>When placed on a class that subclasses <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html">PostingsFormat</a>, adding this |
| attribute will exclude the type from consideration in the |
| <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_ScanForPostingsFormats_System_Reflection_Assembly_">ScanForPostingsFormats(Assembly)</a> method. |
| <p> |
| However, the <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html">PostingsFormat</a> type can still be added manually using |
| <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_PutPostingsFormatType_System_Type_">PutPostingsFormatType(Type)</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.FieldInfosFormat.html">FieldInfosFormat</a></h4> |
| <section><p>Encodes/decodes <a class="xref" href="Lucene.Net.Index.FieldInfos.html">FieldInfos</a>. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.FieldInfosReader.html">FieldInfosReader</a></h4> |
| <section><p>Codec API for reading <a class="xref" href="Lucene.Net.Index.FieldInfos.html">FieldInfos</a>. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.FieldInfosWriter.html">FieldInfosWriter</a></h4> |
| <section><p>Codec API for writing <a class="xref" href="Lucene.Net.Index.FieldInfos.html">FieldInfos</a>. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.FieldsConsumer.html">FieldsConsumer</a></h4> |
| <section><p>Abstract API that consumes terms, doc, freq, prox, offset and |
| payloads postings. Concrete implementations of this |
| actually do "something" with the postings (write it into |
| the index in a specific format). |
| <p> |
| The lifecycle is: |
| <ol><li>FieldsConsumer is created by |
| <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html#Lucene_Net_Codecs_PostingsFormat_FieldsConsumer_Lucene_Net_Index_SegmentWriteState_">FieldsConsumer(SegmentWriteState)</a>.</li><li>For each field, <a class="xref" href="Lucene.Net.Codecs.FieldsConsumer.html#Lucene_Net_Codecs_FieldsConsumer_AddField_Lucene_Net_Index_FieldInfo_">AddField(FieldInfo)</a> is called, |
| returning a <a class="xref" href="Lucene.Net.Codecs.TermsConsumer.html">TermsConsumer</a> for the field.</li><li>After all fields are added, the consumer is <a class="xref" href="Lucene.Net.Codecs.FieldsConsumer.html#Lucene_Net_Codecs_FieldsConsumer_Dispose">Dispose()</a>d.</li></ol> |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.FieldsProducer.html">FieldsProducer</a></h4> |
| <section><p>Abstract API that produces terms, doc, freq, prox, offset and |
| payloads postings. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.FilterCodec.html">FilterCodec</a></h4> |
| <section><p>A codec that forwards all its method calls to another codec. |
| <p> |
| Extend this class when you need to reuse the functionality of an existing |
| codec. For example, if you want to build a codec that redefines Lucene46's |
| <a class="xref" href="Lucene.Net.Codecs.LiveDocsFormat.html">LiveDocsFormat</a>:</p> |
| <pre><code> public sealed class CustomCodec : FilterCodec |
| { |
| public CustomCodec() |
| : base("CustomCodec", new Lucene46Codec()) |
| { |
| } |
| |
| public override LiveDocsFormat LiveDocsFormat |
| { |
| get { return new CustomLiveDocsFormat(); } |
| } |
| }</code></pre> |
| |
| <p><p> |
| <em>Please note:</em> Don't call <a class="xref" href="Lucene.Net.Codecs.Codec.html#Lucene_Net_Codecs_Codec_ForName_System_String_">ForName(String)</a> from |
| the no-arg constructor of your own codec. When the <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a> |
| loads your own <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a>, the <a class="xref" href="Lucene.Net.Codecs.DefaultCodecFactory.html">DefaultCodecFactory</a> has not yet fully initialized! |
| If you want to extend another <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a>, instantiate it directly by calling |
| its constructor. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.LiveDocsFormat.html">LiveDocsFormat</a></h4> |
| <section><p>Format for live/deleted documents. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.MappingMultiDocsAndPositionsEnum.html">MappingMultiDocsAndPositionsEnum</a></h4> |
| <section><p>Exposes flex API, merged from flex API of sub-segments, |
| remapping docIDs (this is used for segment merging). |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.MappingMultiDocsEnum.html">MappingMultiDocsEnum</a></h4> |
| <section><p>Exposes flex API, merged from flex API of sub-segments, |
| remapping docIDs (this is used for segment merging). |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.MultiLevelSkipListReader.html">MultiLevelSkipListReader</a></h4> |
| <section><p>This abstract class reads skip lists with multiple levels. |
| <p> |
| See <a class="xref" href="Lucene.Net.Codecs.MultiLevelSkipListWriter.html">MultiLevelSkipListWriter</a> for the information about the encoding |
| of the multi level skip lists. |
| <p> |
| Subclasses must implement the abstract method <a class="xref" href="Lucene.Net.Codecs.MultiLevelSkipListReader.html#Lucene_Net_Codecs_MultiLevelSkipListReader_ReadSkipData_System_Int32_Lucene_Net_Store_IndexInput_">ReadSkipData(Int32, IndexInput)</a> |
| which defines the actual format of the skip data. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.MultiLevelSkipListWriter.html">MultiLevelSkipListWriter</a></h4> |
| <section><p>This abstract class writes skip lists with multiple levels.</p> |
| <pre><code>Example for skipInterval = 3: |
| c (skip level 2) |
| c c c (skip level 1) |
| x x x x x x x x x x (skip level 0) |
| d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d (posting list) |
| 3 6 9 12 15 18 21 24 27 30 (df) |
| |
| d - document |
| x - skip data |
| c - skip data with child pointer |
| |
| Skip level i contains every skipInterval-th entry from skip level i-1. |
| Therefore the number of entries on level i is: floor(df / ((skipInterval ^ (i + 1))). |
| |
| Each skip entry on a level i>0 contains a pointer to the corresponding skip entry in list i-1. |
| this guarantees a logarithmic amount of skips to find the target document. |
| |
| While this class takes care of writing the different skip levels, |
| subclasses must define the actual format of the skip data.</code></pre> |
| <p><p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.NormsFormat.html">NormsFormat</a></h4> |
| <section><p>Encodes/decodes per-document score normalization values.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.PostingsBaseFormat.html">PostingsBaseFormat</a></h4> |
| <section><p>Provides a <a class="xref" href="Lucene.Net.Codecs.PostingsReaderBase.html">PostingsReaderBase</a> and |
| <a class="xref" href="Lucene.Net.Codecs.PostingsWriterBase.html">PostingsWriterBase</a>. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.PostingsConsumer.html">PostingsConsumer</a></h4> |
| <section><p>Abstract API that consumes postings for an individual term. |
| <p> |
| The lifecycle is: |
| <ol><li>PostingsConsumer is returned for each term by |
| <a class="xref" href="Lucene.Net.Codecs.TermsConsumer.html#Lucene_Net_Codecs_TermsConsumer_StartTerm_Lucene_Net_Util_BytesRef_">StartTerm(BytesRef)</a>.</li><li><a class="xref" href="Lucene.Net.Codecs.PostingsConsumer.html#Lucene_Net_Codecs_PostingsConsumer_StartDoc_System_Int32_System_Int32_">StartDoc(Int32, Int32)</a> is called for each |
| document where the term occurs, specifying id |
| and term frequency for that document.</li><li>If positions are enabled for the field, then |
| <a class="xref" href="Lucene.Net.Codecs.PostingsConsumer.html#Lucene_Net_Codecs_PostingsConsumer_AddPosition_System_Int32_Lucene_Net_Util_BytesRef_System_Int32_System_Int32_">AddPosition(Int32, BytesRef, Int32, Int32)</a> |
| will be called for each occurrence in the |
| document.</li><li><a class="xref" href="Lucene.Net.Codecs.PostingsConsumer.html#Lucene_Net_Codecs_PostingsConsumer_FinishDoc">FinishDoc()</a> is called when the producer |
| is done adding positions to the document.</li></ol> |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html">PostingsFormat</a></h4> |
| <section><p>Encodes/decodes terms, postings, and proximity data. |
| <p> |
| Note, when extending this class, the name (<a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html#Lucene_Net_Codecs_PostingsFormat_Name">Name</a>) may |
| written into the index in certain configurations. In order for the segment |
| to be read, the name must resolve to your implementation via <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html#Lucene_Net_Codecs_PostingsFormat_ForName_System_String_">ForName(String)</a>. |
| This method uses <a class="xref" href="Lucene.Net.Codecs.IPostingsFormatFactory.html#Lucene_Net_Codecs_IPostingsFormatFactory_GetPostingsFormat_System_String_">GetPostingsFormat(String)</a> to resolve format names. |
| <p> |
| If you implement your own format: |
| <ol><li>Subclass this class.</li><li>Subclass <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html">DefaultPostingsFormatFactory</a>, override <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_Initialize">Initialize()</a>, |
| and add the line <code>base.ScanForPostingsFormats(typeof(YourPostingsFormat).GetTypeInfo().Assembly)</code>. |
| If you have any format classes in your assembly |
| that are not meant for reading, you can add the <a class="xref" href="Lucene.Net.Codecs.ExcludePostingsFormatFromScanAttribute.html">ExcludePostingsFormatFromScanAttribute</a> |
| to them so they are ignored by the scan.</li><li>Set the new <a class="xref" href="Lucene.Net.Codecs.IPostingsFormatFactory.html">IPostingsFormatFactory</a> by calling <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html#Lucene_Net_Codecs_PostingsFormat_SetPostingsFormatFactory_Lucene_Net_Codecs_IPostingsFormatFactory_">SetPostingsFormatFactory(IPostingsFormatFactory)</a> |
| at application startup.</li></ol> |
| If your format has dependencies, you may also override <a class="xref" href="Lucene.Net.Codecs.DefaultPostingsFormatFactory.html#Lucene_Net_Codecs_DefaultPostingsFormatFactory_GetPostingsFormat_System_Type_">GetPostingsFormat(Type)</a> to inject |
| them via pure DI or a DI container. See <a href="http://blog.ploeh.dk/2014/05/19/di-friendly-framework/">DI-Friendly Framework</a> |
| to understand the approach used. |
| <p> |
| <strong>PostingsFormat Names</strong> |
| <p> |
| 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". |
| <p> |
| You can override this default behavior by using the <a class="xref" href="Lucene.Net.Codecs.PostingsFormatNameAttribute.html">PostingsFormatNameAttribute</a> to |
| name the format differently than this convention. Format names must be all ASCII alphanumeric, |
| and less than 128 characters in length. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.PostingsFormatNameAttribute.html">PostingsFormatNameAttribute</a></h4> |
| <section><p>Represents an attribute that is used to name a <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html">PostingsFormat</a>, if a name |
| other than the default <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html">PostingsFormat</a> naming convention is desired.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.PostingsReaderBase.html">PostingsReaderBase</a></h4> |
| <section><p>The core terms dictionaries (BlockTermsReader, |
| <a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsReader.html">BlockTreeTermsReader</a>) interact with a single instance |
| of this class to manage creation of <a class="xref" href="Lucene.Net.Index.DocsEnum.html">DocsEnum</a> and |
| <a class="xref" href="Lucene.Net.Index.DocsAndPositionsEnum.html">DocsAndPositionsEnum</a> instances. It provides an |
| <a class="xref" href="Lucene.Net.Store.IndexInput.html">IndexInput</a> (termsIn) where this class may read any |
| previously stored data that it had written in its |
| corresponding <a class="xref" href="Lucene.Net.Codecs.PostingsWriterBase.html">PostingsWriterBase</a> at indexing |
| time. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.PostingsWriterBase.html">PostingsWriterBase</a></h4> |
| <section><p>Extension of <a class="xref" href="Lucene.Net.Codecs.PostingsConsumer.html">PostingsConsumer</a> to support pluggable term dictionaries. |
| <p> |
| This class contains additional hooks to interact with the provided |
| term dictionaries such as <a class="xref" href="Lucene.Net.Codecs.BlockTreeTermsWriter.html">BlockTreeTermsWriter</a>. If you want |
| to re-use an existing implementation and are only interested in |
| customizing the format of the postings list, extend this class |
| instead. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.SegmentInfoFormat.html">SegmentInfoFormat</a></h4> |
| <section><p>Expert: Controls the format of the |
| <a class="xref" href="Lucene.Net.Index.SegmentInfo.html">SegmentInfo</a> (segment metadata file). |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.SegmentInfoReader.html">SegmentInfoReader</a></h4> |
| <section><p>Specifies an API for classes that can read <a class="xref" href="Lucene.Net.Index.SegmentInfo.html">SegmentInfo</a> information. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.SegmentInfoWriter.html">SegmentInfoWriter</a></h4> |
| <section><p>Specifies an API for classes that can write out <a class="xref" href="Lucene.Net.Index.SegmentInfo.html">SegmentInfo</a> data. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.StoredFieldsFormat.html">StoredFieldsFormat</a></h4> |
| <section><p>Controls the format of stored fields.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.StoredFieldsReader.html">StoredFieldsReader</a></h4> |
| <section><p>Codec API for reading stored fields. |
| <p> |
| You need to implement <a class="xref" href="Lucene.Net.Codecs.StoredFieldsReader.html#Lucene_Net_Codecs_StoredFieldsReader_VisitDocument_System_Int32_Lucene_Net_Index_StoredFieldVisitor_">VisitDocument(Int32, StoredFieldVisitor)</a> to |
| read the stored fields for a document, implement <a class="xref" href="Lucene.Net.Codecs.StoredFieldsReader.html#Lucene_Net_Codecs_StoredFieldsReader_Clone">Clone()</a> (creating |
| clones of any <a class="xref" href="Lucene.Net.Store.IndexInput.html">IndexInput</a>s used, etc), and <a class="xref" href="Lucene.Net.Codecs.StoredFieldsReader.html#Lucene_Net_Codecs_StoredFieldsReader_Dispose_System_Boolean_">Dispose(Boolean)</a> |
| to cleanup any allocated resources. |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.StoredFieldsWriter.html">StoredFieldsWriter</a></h4> |
| <section><p>Codec API for writing stored fields: |
| <p> |
| <ol><li>For every document, <a class="xref" href="Lucene.Net.Codecs.StoredFieldsWriter.html#Lucene_Net_Codecs_StoredFieldsWriter_StartDocument_System_Int32_">StartDocument(Int32)</a> is called, |
| informing the Codec how many fields will be written.</li><li><a class="xref" href="Lucene.Net.Codecs.StoredFieldsWriter.html#Lucene_Net_Codecs_StoredFieldsWriter_WriteField_Lucene_Net_Index_FieldInfo_Lucene_Net_Index_IIndexableField_">WriteField(FieldInfo, IIndexableField)</a> is called for |
| each field in the document.</li><li>After all documents have been written, <a class="xref" href="Lucene.Net.Codecs.StoredFieldsWriter.html#Lucene_Net_Codecs_StoredFieldsWriter_Finish_Lucene_Net_Index_FieldInfos_System_Int32_">Finish(FieldInfos, Int32)</a> |
| is called for verification/sanity-checks.</li><li>Finally the writer is disposed (<a class="xref" href="Lucene.Net.Codecs.StoredFieldsWriter.html#Lucene_Net_Codecs_StoredFieldsWriter_Dispose_System_Boolean_">Dispose(Boolean)</a>)</li></ol> |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.TermsConsumer.html">TermsConsumer</a></h4> |
| <section><p>Abstract API that consumes terms for an individual field. |
| <p> |
| The lifecycle is: |
| <ol><li>TermsConsumer is returned for each field |
| by <a class="xref" href="Lucene.Net.Codecs.FieldsConsumer.html#Lucene_Net_Codecs_FieldsConsumer_AddField_Lucene_Net_Index_FieldInfo_">AddField(FieldInfo)</a>.</li><li>TermsConsumer returns a <a class="xref" href="Lucene.Net.Codecs.PostingsConsumer.html">PostingsConsumer</a> for |
| each term in <a class="xref" href="Lucene.Net.Codecs.TermsConsumer.html#Lucene_Net_Codecs_TermsConsumer_StartTerm_Lucene_Net_Util_BytesRef_">StartTerm(BytesRef)</a>.</li><li>When the producer (e.g. IndexWriter) |
| is done adding documents for the term, it calls |
| <a class="xref" href="Lucene.Net.Codecs.TermsConsumer.html#Lucene_Net_Codecs_TermsConsumer_FinishTerm_Lucene_Net_Util_BytesRef_Lucene_Net_Codecs_TermStats_">FinishTerm(BytesRef, TermStats)</a>, passing in |
| the accumulated term statistics.</li><li>Producer calls <a class="xref" href="Lucene.Net.Codecs.TermsConsumer.html#Lucene_Net_Codecs_TermsConsumer_Finish_System_Int64_System_Int64_System_Int32_">Finish(Int64, Int64, Int32)</a> with |
| the accumulated collection statistics when it is finished |
| adding terms to the field.</li></ol> |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.TermStats.html">TermStats</a></h4> |
| <section><p>Holder for per-term statistics.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.TermVectorsFormat.html">TermVectorsFormat</a></h4> |
| <section><p>Controls the format of term vectors.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.TermVectorsReader.html">TermVectorsReader</a></h4> |
| <section><p>Codec API for reading term vectors: |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.TermVectorsWriter.html">TermVectorsWriter</a></h4> |
| <section><p>Codec API for writing term vectors: |
| <p> |
| <ol><li>For every document, <a class="xref" href="Lucene.Net.Codecs.TermVectorsWriter.html#Lucene_Net_Codecs_TermVectorsWriter_StartDocument_System_Int32_">StartDocument(Int32)</a> is called, |
| informing the <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a> how many fields will be written.</li><li><a class="xref" href="Lucene.Net.Codecs.TermVectorsWriter.html#Lucene_Net_Codecs_TermVectorsWriter_StartField_Lucene_Net_Index_FieldInfo_System_Int32_System_Boolean_System_Boolean_System_Boolean_">StartField(FieldInfo, Int32, Boolean, Boolean, Boolean)</a> is called for |
| each field in the document, informing the codec how many terms |
| will be written for that field, and whether or not positions, |
| offsets, or payloads are enabled.</li><li>Within each field, <a class="xref" href="Lucene.Net.Codecs.TermVectorsWriter.html#Lucene_Net_Codecs_TermVectorsWriter_StartTerm_Lucene_Net_Util_BytesRef_System_Int32_">StartTerm(BytesRef, Int32)</a> is called |
| for each term.</li><li>If offsets and/or positions are enabled, then |
| <a class="xref" href="Lucene.Net.Codecs.TermVectorsWriter.html#Lucene_Net_Codecs_TermVectorsWriter_AddPosition_System_Int32_System_Int32_System_Int32_Lucene_Net_Util_BytesRef_">AddPosition(Int32, Int32, Int32, BytesRef)</a> will be called for each term |
| occurrence.</li><li>After all documents have been written, <a class="xref" href="Lucene.Net.Codecs.TermVectorsWriter.html#Lucene_Net_Codecs_TermVectorsWriter_Finish_Lucene_Net_Index_FieldInfos_System_Int32_">Finish(FieldInfos, Int32)</a> |
| is called for verification/sanity-checks.</li><li>Finally the writer is disposed (<a class="xref" href="Lucene.Net.Codecs.TermVectorsWriter.html#Lucene_Net_Codecs_TermVectorsWriter_Dispose_System_Boolean_">Dispose(Boolean)</a>)</li></ol> |
| <p> |
| <div class="lucene-block lucene-experimental">This is a Lucene.NET EXPERIMENTAL API, use at your own risk</div></section> |
| <h3 id="interfaces">Interfaces |
| </h3> |
| <h4><a class="xref" href="Lucene.Net.Codecs.ICodecFactory.html">ICodecFactory</a></h4> |
| <section><p>LUCENENET specific contract for extending the functionality of <a class="xref" href="Lucene.Net.Codecs.Codec.html">Codec</a> implementations so |
| they can be injected with dependencies. |
| <p> |
| To set the <a class="xref" href="Lucene.Net.Codecs.ICodecFactory.html">ICodecFactory</a>, call <a class="xref" href="Lucene.Net.Codecs.Codec.html#Lucene_Net_Codecs_Codec_SetCodecFactory_Lucene_Net_Codecs_ICodecFactory_">SetCodecFactory(ICodecFactory)</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.IDocValuesFormatFactory.html">IDocValuesFormatFactory</a></h4> |
| <section><p>LUCENENET specific contract for extending the functionality of <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html">DocValuesFormat</a> implementations so |
| they can be injected with dependencies. |
| <p> |
| To set the <a class="xref" href="Lucene.Net.Codecs.IDocValuesFormatFactory.html">IDocValuesFormatFactory</a>, call <a class="xref" href="Lucene.Net.Codecs.DocValuesFormat.html#Lucene_Net_Codecs_DocValuesFormat_SetDocValuesFormatFactory_Lucene_Net_Codecs_IDocValuesFormatFactory_">SetDocValuesFormatFactory(IDocValuesFormatFactory)</a>.</p> |
| </section> |
| <h4><a class="xref" href="Lucene.Net.Codecs.IPostingsFormatFactory.html">IPostingsFormatFactory</a></h4> |
| <section><p>LUCENENET specific contract for extending the functionality of <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html">PostingsFormat</a> implementations so |
| they can be injected with dependencies. |
| <p> |
| To set the <a class="xref" href="Lucene.Net.Codecs.IPostingsFormatFactory.html">IPostingsFormatFactory</a>, call <a class="xref" href="Lucene.Net.Codecs.PostingsFormat.html#Lucene_Net_Codecs_PostingsFormat_SetPostingsFormatFactory_Lucene_Net_Codecs_IPostingsFormatFactory_">SetPostingsFormatFactory(IPostingsFormatFactory)</a>.</p> |
| </section> |
| </article> |
| </div> |
| |
| <div class="hidden-sm col-md-2" role="complementary"> |
| <div class="sideaffix"> |
| <div class="contribution"> |
| <ul class="nav"> |
| <li> |
| <a href="https://github.com/apache/lucenenet/blob/docs-4.8.0-beta00007/src/Lucene.Net.TestFramework/Codecs/package.md/#L2" class="contribution-link">Improve this Doc</a> |
| </li> |
| </ul> |
| </div> |
| <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix"> |
| <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> --> |
| </nav> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| <footer> |
| <div class="grad-bottom"></div> |
| <div class="footer"> |
| <div class="container"> |
| <span class="pull-right"> |
| <a href="#top">Back to top</a> |
| </span> |
| Copyright © 2020 Licensed to the Apache Software Foundation (ASF) |
| |
| </div> |
| </div> |
| </footer> |
| </div> |
| |
| <script type="text/javascript" src="../../styles/docfx.vendor.js"></script> |
| <script type="text/javascript" src="../../styles/docfx.js"></script> |
| <script type="text/javascript" src="../../styles/main.js"></script> |
| </body> |
| </html> |