http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Codecs/Lucene41/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Lucene41/package.md 
b/src/Lucene.Net/Codecs/Lucene41/package.md
new file mode 100644
index 0000000..7da6918
--- /dev/null
+++ b/src/Lucene.Net/Codecs/Lucene41/package.md
@@ -0,0 +1,346 @@
+
+<!--
+ 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.
+-->
+
+Lucene 4.1 file format.
+
+# Apache Lucene - Index File Formats
+
+<div>
+
+*   [Introduction](#Introduction)
+*   [Definitions](#Definitions)
+
+    *   [Inverted Indexing](#Inverted_Indexing)
+    *   [Types of Fields](#Types_of_Fields)
+    *   [Segments](#Segments)
+    *   [Document Numbers](#Document_Numbers)
+
+*   [Index Structure Overview](#Overview)
+*   [File Naming](#File_Naming)
+*   [Summary of File Extensions](#file-names)
+*   *   [Lock File](#Lock_File)
+    *   [History](#History)
+    *   [Limitations](#Limitations)
+
+</div>
+
+## Introduction
+
+<div>
+
+This document defines the index file formats used in this version of Lucene. 
If you are using a different version of Lucene, please consult the copy of 
`docs/` that was distributed with the version you are using.
+
+Apache Lucene is written in Java, but several efforts are underway to write 
[versions of Lucene in other programming 
languages](http://wiki.apache.org/lucene-java/LuceneImplementations). If these 
versions are to remain compatible with Apache Lucene, then a 
language-independent definition of the Lucene index format is required. This 
document thus attempts to provide a complete and independent definition of the 
Apache Lucene file formats.
+
+As Lucene evolves, this document should evolve. Versions of Lucene in 
different programming languages should endeavor to agree on file formats, and 
generate new versions of this document.
+
+</div>
+
+## Definitions
+
+<div>
+
+The fundamental concepts in Lucene are index, document, field and term.
+
+An index contains a sequence of documents.
+
+*   A document is a sequence of fields.
+*   A field is a named sequence of terms.
+*   A term is a sequence of bytes.
+
+The same sequence of bytes in two different fields is considered a different 
term. Thus terms are represented as a pair: the string naming the field, and 
the bytes within the field.
+
+### Inverted Indexing
+
+The index stores statistics about terms in order to make term-based search 
more efficient. Lucene's index falls into the family of indexes known as an 
*inverted index.* This is because it can list, for a term, the documents that 
contain it. This is the inverse of the natural relationship, in which documents 
list terms.
+
+### Types of Fields
+
+In Lucene, fields may be *stored*, in which case their text is stored in the 
index literally, in a non-inverted manner. Fields that are inverted are called 
*indexed*. A field may be both stored and indexed.
+
+The text of a field may be *tokenized* into terms to be indexed, or the text 
of a field may be used literally as a term to be indexed. Most fields are 
tokenized, but sometimes it is useful for certain identifier fields to be 
indexed literally.
+
+See the [](xref:Lucene.Net.Documents.Field Field) java docs for more 
information on Fields.
+
+### Segments
+
+Lucene indexes may be composed of multiple sub-indexes, or *segments*. Each 
segment is a fully independent index, which could be searched separately. 
Indexes evolve by:
+
+1.  Creating new segments for newly added documents.
+2.  Merging existing segments.
+
+Searches may involve multiple segments and/or multiple indexes, each index 
potentially composed of a set of segments.
+
+### Document Numbers
+
+Internally, Lucene refers to documents by an integer *document number*. The 
first document added to an index is numbered zero, and each subsequent document 
added gets a number one greater than the previous.
+
+Note that a document's number may change, so caution should be taken when 
storing these numbers outside of Lucene. In particular, numbers may change in 
the following situations:
+
+*   
+
+The numbers stored in each segment are unique only within the segment, and 
must be converted before they can be used in a larger context. The standard 
technique is to allocate each segment a range of values, based on the range of 
numbers used in that segment. To convert a document number from a segment to an 
external value, the segment's *base* document number is added. To convert an 
external value back to a segment-specific value, the segment is identified by 
the range that the external value is in, and the segment's base value is 
subtracted. For example two five document segments might be combined, so that 
the first segment has a base value of zero, and the second of five. Document 
three from the second segment would have an external value of eight.
+
+*   
+
+When documents are deleted, gaps are created in the numbering. These are 
eventually removed as the index evolves through merging. Deleted documents are 
dropped when segments are merged. A freshly-merged segment thus has no gaps in 
its numbering.
+
+</div>
+
+## Index Structure Overview
+
+<div>
+
+Each segment index maintains the following:
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40SegmentInfoFormat Segment info).
+   This contains metadata about a segment, such as the number of documents,
+   what files it uses, 
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40FieldInfosFormat Field names). 
+   This contains the set of field names used in the index.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Stored Field 
values). 
+This contains, for each document, a list of attribute-value pairs, where the 
attributes 
+are field names. These are used to store auxiliary information about the 
document, such as 
+its title, url, or an identifier to access a database. The set of stored 
fields are what is 
+returned for each hit when searching. This is keyed by document number.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term 
dictionary). 
+A dictionary containing all of the terms used in all of the
+indexed fields of all of the documents. The dictionary also contains the number
+of documents which contain the term, and pointers to the term's frequency and
+proximity data.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Frequency 
data). 
+For each term in the dictionary, the numbers of all the
+documents that contain that term, and the frequency of the term in that
+document, unless frequencies are omitted (IndexOptions.DOCS_ONLY)
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Proximity 
data). 
+For each term in the dictionary, the positions that the
+term occurs in each document. Note that this will not exist if all fields in
+all documents omit position data.
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40NormsFormat Normalization 
factors). 
+For each field in each document, a value is stored
+that is multiplied into the score for hits on that field.
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40TermVectorsFormat Term 
Vectors). 
+For each field in each document, the term vector (sometimes
+called document vector) may be stored. A term vector consists of term text and
+term frequency. To add Term Vectors to your index see the 
+[](xref:Lucene.Net.Documents.Field Field) constructors
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40DocValuesFormat Per-document 
values). 
+Like stored values, these are also keyed by document
+number, but are generally intended to be loaded into main memory for fast
+access. Whereas stored values are generally intended for summary results from
+searches, per-document values are useful for things like scoring factors.
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40LiveDocsFormat Deleted 
documents). 
+An optional file indicating which documents are deleted.
+
+Details on each of these are provided in their linked pages.
+
+</div>
+
+## File Naming
+
+<div>
+
+All files belonging to a segment have the same name with varying extensions. 
The extensions correspond to the different file formats described below. When 
using the Compound File format (default in 1.4 and greater) these files (except 
for the Segment info file, the Lock file, and Deleted documents file) are 
collapsed into a single .cfs file (see below for details)
+
+Typically, all segments in an index are stored in a single directory, although 
this is not required.
+
+As of version 2.1 (lock-less commits), file names are never re-used (there is 
one exception, "segments.gen", see below). That is, when any file is saved to 
the Directory it is given a never before used filename. This is achieved using 
a simple generations approach. For example, the first segments file is 
segments_1, then segments_2, etc. The generation is a sequential long integer 
represented in alpha-numeric (base 36) form.
+
+</div>
+
+## Summary of File Extensions
+
+<div>
+
+The following table summarizes the names and extensions of the files in Lucene:
+
+<table cellspacing="1" cellpadding="4">
+<tr>
+<th>Name</th>
+<th>Extension</th>
+<th>Brief Description</th>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Index.SegmentInfos Segments File)</td>
+<td>segments.gen, segments_N</td>
+<td>Stores information about a commit point</td>
+</tr>
+<tr>
+<td>[Lock File](#Lock_File)</td>
+<td>write.lock</td>
+<td>The Write lock prevents multiple IndexWriters from writing to the same
+file.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40SegmentInfoFormat Segment 
Info)</td>
+<td>.si</td>
+<td>Stores metadata about a segment</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Store.CompoundFileDirectory Compound File)</td>
+<td>.cfs, .cfe</td>
+<td>An optional "virtual" file consisting of all the other index files for
+systems that frequently run out of file handles.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40FieldInfosFormat Fields)</td>
+<td>.fnm</td>
+<td>Stores information about the fields</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Field 
Index)</td>
+<td>.fdx</td>
+<td>Contains pointers to field data</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Field 
Data)</td>
+<td>.fdt</td>
+<td>The stored fields for documents</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term 
Dictionary)</td>
+<td>.tim</td>
+<td>The term dictionary, stores term info</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Index)</td>
+<td>.tip</td>
+<td>The index into the Term Dictionary</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Frequencies)</td>
+<td>.doc</td>
+<td>Contains the list of docs which contain each term along with frequency</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Positions)</td>
+<td>.pos</td>
+<td>Stores position information about where a term occurs in the index</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Payloads)</td>
+<td>.pay</td>
+<td>Stores additional per-position metadata information such as character 
offsets and user payloads</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40NormsFormat Norms)</td>
+<td>.nrm.cfs, .nrm.cfe</td>
+<td>Encodes length and boost factors for docs and fields</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40DocValuesFormat Per-Document 
Values)</td>
+<td>.dv.cfs, .dv.cfe</td>
+<td>Encodes additional scoring factors or other per-document information.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40TermVectorsFormat Term Vector 
Index)</td>
+<td>.tvx</td>
+<td>Stores offset into the document data file</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40TermVectorsFormat Term Vector 
Documents)</td>
+<td>.tvd</td>
+<td>Contains information about each document that has term vectors</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40TermVectorsFormat Term Vector 
Fields)</td>
+<td>.tvf</td>
+<td>The field level info about term vectors</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40LiveDocsFormat Deleted 
Documents)</td>
+<td>.del</td>
+<td>Info about what files are deleted</td>
+</tr>
+</table>
+</div>
+
+## Lock File
+
+The write lock, which is stored in the index directory by default, is named
+"write.lock". If the lock directory is different from the index directory then
+the write lock will be named "XXXX-write.lock" where XXXX is a unique prefix
+derived from the full path to the index directory. When this file is present, a
+writer is currently modifying the index (adding or removing documents). This
+lock file ensures that only one writer is modifying the index at a time.
+
+## History
+
+Compatibility notes are provided in this document, describing how file formats 
have changed from prior versions:
+
+*   In version 2.1, the file format was changed to allow lock-less commits (ie,
+no more commit lock). The change is fully backwards compatible: you can open a
+pre-2.1 index for searching or adding/deleting of docs. When the new segments
+file is saved (committed), it will be written in the new file format (meaning
+no specific "upgrade" process is needed). But note that once a commit has
+occurred, pre-2.1 Lucene will not be able to read the index.
+*   In version 2.3, the file format was changed to allow segments to share a
+single set of doc store (vectors & stored fields) files. This allows for
+faster indexing in certain cases. The change is fully backwards compatible (in
+the same way as the lock-less commits change in 2.1).
+*   In version 2.4, Strings are now written as true UTF-8 byte sequence, not
+Java's modified UTF-8. See [
+LUCENE-510](http://issues.apache.org/jira/browse/LUCENE-510) for details.
+*   In version 2.9, an optional opaque Map<String,String> CommitUserData
+may be passed to IndexWriter's commit methods (and later retrieved), which is
+recorded in the segments_N file. See [
+LUCENE-1382](http://issues.apache.org/jira/browse/LUCENE-1382) for details. 
Also,
+diagnostics were added to each segment written recording details about why it
+was written (due to flush, merge; which OS/JRE was used; etc.). See issue
+[LUCENE-1654](http://issues.apache.org/jira/browse/LUCENE-1654) for details.
+*   In version 3.0, compressed fields are no longer written to the index (they
+can still be read, but on merge the new segment will write them, uncompressed).
+See issue [LUCENE-1960](http://issues.apache.org/jira/browse/LUCENE-1960) 
+for details.
+*   In version 3.1, segments records the code version that created them. See
+[LUCENE-2720](http://issues.apache.org/jira/browse/LUCENE-2720) for details. 
+Additionally segments track explicitly whether or not they have term vectors. 
+See [LUCENE-2811](http://issues.apache.org/jira/browse/LUCENE-2811) 
+for details.
+*   In version 3.2, numeric fields are written as natively to stored fields
+file, previously they were stored in text format only.
+*   In version 3.4, fields can omit position data while still indexing term
+frequencies.
+*   In version 4.0, the format of the inverted index became extensible via
+the [](xref:Lucene.Net.Codecs.Codec Codec) api. Fast per-document storage
+({@code DocValues}) was introduced. Normalization factors need no longer be a 
+single byte, they can be any [](xref:Lucene.Net.Index.NumericDocValues 
NumericDocValues). 
+Terms need not be unicode strings, they can be any byte sequence. Term offsets 
+can optionally be indexed into the postings lists. Payloads can be stored in 
the 
+term vectors.
+*   In version 4.1, the format of the postings list changed to use either
+of FOR compression or variable-byte encoding, depending upon the frequency
+of the term. Terms appearing only once were changed to inline directly into
+the term dictionary. Stored fields are compressed by default. 
+
+## Limitations
+
+<div>
+
+Lucene uses a Java `int` to refer to document numbers, and the index file 
format uses an `Int32` on-disk to store document numbers. This is a limitation 
of both the index file format and the current implementation. Eventually these 
should be replaced with either `UInt64` values, or better yet, 
[](xref:Lucene.Net.Store.DataOutput.WriteVInt VInt) values which have no limit.
+
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Codecs/Lucene42/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Lucene42/package.md 
b/src/Lucene.Net/Codecs/Lucene42/package.md
new file mode 100644
index 0000000..c3679a3
--- /dev/null
+++ b/src/Lucene.Net/Codecs/Lucene42/package.md
@@ -0,0 +1,349 @@
+
+<!--
+ 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.
+-->
+
+Lucene 4.2 file format.
+
+# Apache Lucene - Index File Formats
+
+<div>
+
+*   [Introduction](#Introduction)
+*   [Definitions](#Definitions)
+
+    *   [Inverted Indexing](#Inverted_Indexing)
+    *   [Types of Fields](#Types_of_Fields)
+    *   [Segments](#Segments)
+    *   [Document Numbers](#Document_Numbers)
+
+*   [Index Structure Overview](#Overview)
+*   [File Naming](#File_Naming)
+*   [Summary of File Extensions](#file-names)
+*   *   [Lock File](#Lock_File)
+    *   [History](#History)
+    *   [Limitations](#Limitations)
+
+</div>
+
+## Introduction
+
+<div>
+
+This document defines the index file formats used in this version of Lucene. 
If you are using a different version of Lucene, please consult the copy of 
`docs/` that was distributed with the version you are using.
+
+Apache Lucene is written in Java, but several efforts are underway to write 
[versions of Lucene in other programming 
languages](http://wiki.apache.org/lucene-java/LuceneImplementations). If these 
versions are to remain compatible with Apache Lucene, then a 
language-independent definition of the Lucene index format is required. This 
document thus attempts to provide a complete and independent definition of the 
Apache Lucene file formats.
+
+As Lucene evolves, this document should evolve. Versions of Lucene in 
different programming languages should endeavor to agree on file formats, and 
generate new versions of this document.
+
+</div>
+
+## Definitions
+
+<div>
+
+The fundamental concepts in Lucene are index, document, field and term.
+
+An index contains a sequence of documents.
+
+*   A document is a sequence of fields.
+*   A field is a named sequence of terms.
+*   A term is a sequence of bytes.
+
+The same sequence of bytes in two different fields is considered a different 
term. Thus terms are represented as a pair: the string naming the field, and 
the bytes within the field.
+
+### Inverted Indexing
+
+The index stores statistics about terms in order to make term-based search 
more efficient. Lucene's index falls into the family of indexes known as an 
*inverted index.* This is because it can list, for a term, the documents that 
contain it. This is the inverse of the natural relationship, in which documents 
list terms.
+
+### Types of Fields
+
+In Lucene, fields may be *stored*, in which case their text is stored in the 
index literally, in a non-inverted manner. Fields that are inverted are called 
*indexed*. A field may be both stored and indexed.
+
+The text of a field may be *tokenized* into terms to be indexed, or the text 
of a field may be used literally as a term to be indexed. Most fields are 
tokenized, but sometimes it is useful for certain identifier fields to be 
indexed literally.
+
+See the [](xref:Lucene.Net.Documents.Field Field) java docs for more 
information on Fields.
+
+### Segments
+
+Lucene indexes may be composed of multiple sub-indexes, or *segments*. Each 
segment is a fully independent index, which could be searched separately. 
Indexes evolve by:
+
+1.  Creating new segments for newly added documents.
+2.  Merging existing segments.
+
+Searches may involve multiple segments and/or multiple indexes, each index 
potentially composed of a set of segments.
+
+### Document Numbers
+
+Internally, Lucene refers to documents by an integer *document number*. The 
first document added to an index is numbered zero, and each subsequent document 
added gets a number one greater than the previous.
+
+Note that a document's number may change, so caution should be taken when 
storing these numbers outside of Lucene. In particular, numbers may change in 
the following situations:
+
+*   
+
+The numbers stored in each segment are unique only within the segment, and 
must be converted before they can be used in a larger context. The standard 
technique is to allocate each segment a range of values, based on the range of 
numbers used in that segment. To convert a document number from a segment to an 
external value, the segment's *base* document number is added. To convert an 
external value back to a segment-specific value, the segment is identified by 
the range that the external value is in, and the segment's base value is 
subtracted. For example two five document segments might be combined, so that 
the first segment has a base value of zero, and the second of five. Document 
three from the second segment would have an external value of eight.
+
+*   
+
+When documents are deleted, gaps are created in the numbering. These are 
eventually removed as the index evolves through merging. Deleted documents are 
dropped when segments are merged. A freshly-merged segment thus has no gaps in 
its numbering.
+
+</div>
+
+## Index Structure Overview
+
+<div>
+
+Each segment index maintains the following:
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40SegmentInfoFormat Segment info).
+   This contains metadata about a segment, such as the number of documents,
+   what files it uses, 
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42FieldInfosFormat Field names). 
+   This contains the set of field names used in the index.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Stored Field 
values). 
+This contains, for each document, a list of attribute-value pairs, where the 
attributes 
+are field names. These are used to store auxiliary information about the 
document, such as 
+its title, url, or an identifier to access a database. The set of stored 
fields are what is 
+returned for each hit when searching. This is keyed by document number.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term 
dictionary). 
+A dictionary containing all of the terms used in all of the
+indexed fields of all of the documents. The dictionary also contains the number
+of documents which contain the term, and pointers to the term's frequency and
+proximity data.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Frequency 
data). 
+For each term in the dictionary, the numbers of all the
+documents that contain that term, and the frequency of the term in that
+document, unless frequencies are omitted (IndexOptions.DOCS_ONLY)
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Proximity 
data). 
+For each term in the dictionary, the positions that the
+term occurs in each document. Note that this will not exist if all fields in
+all documents omit position data.
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42NormsFormat Normalization 
factors). 
+For each field in each document, a value is stored
+that is multiplied into the score for hits on that field.
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term 
Vectors). 
+For each field in each document, the term vector (sometimes
+called document vector) may be stored. A term vector consists of term text and
+term frequency. To add Term Vectors to your index see the 
+[](xref:Lucene.Net.Documents.Field Field) constructors
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42DocValuesFormat Per-document 
values). 
+Like stored values, these are also keyed by document
+number, but are generally intended to be loaded into main memory for fast
+access. Whereas stored values are generally intended for summary results from
+searches, per-document values are useful for things like scoring factors.
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40LiveDocsFormat Deleted 
documents). 
+An optional file indicating which documents are deleted.
+
+Details on each of these are provided in their linked pages.
+
+</div>
+
+## File Naming
+
+<div>
+
+All files belonging to a segment have the same name with varying extensions. 
The extensions correspond to the different file formats described below. When 
using the Compound File format (default in 1.4 and greater) these files (except 
for the Segment info file, the Lock file, and Deleted documents file) are 
collapsed into a single .cfs file (see below for details)
+
+Typically, all segments in an index are stored in a single directory, although 
this is not required.
+
+As of version 2.1 (lock-less commits), file names are never re-used (there is 
one exception, "segments.gen", see below). That is, when any file is saved to 
the Directory it is given a never before used filename. This is achieved using 
a simple generations approach. For example, the first segments file is 
segments_1, then segments_2, etc. The generation is a sequential long integer 
represented in alpha-numeric (base 36) form.
+
+</div>
+
+## Summary of File Extensions
+
+<div>
+
+The following table summarizes the names and extensions of the files in Lucene:
+
+<table cellspacing="1" cellpadding="4">
+<tr>
+<th>Name</th>
+<th>Extension</th>
+<th>Brief Description</th>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Index.SegmentInfos Segments File)</td>
+<td>segments.gen, segments_N</td>
+<td>Stores information about a commit point</td>
+</tr>
+<tr>
+<td>[Lock File](#Lock_File)</td>
+<td>write.lock</td>
+<td>The Write lock prevents multiple IndexWriters from writing to the same
+file.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40SegmentInfoFormat Segment 
Info)</td>
+<td>.si</td>
+<td>Stores metadata about a segment</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Store.CompoundFileDirectory Compound File)</td>
+<td>.cfs, .cfe</td>
+<td>An optional "virtual" file consisting of all the other index files for
+systems that frequently run out of file handles.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42FieldInfosFormat Fields)</td>
+<td>.fnm</td>
+<td>Stores information about the fields</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Field 
Index)</td>
+<td>.fdx</td>
+<td>Contains pointers to field data</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Field 
Data)</td>
+<td>.fdt</td>
+<td>The stored fields for documents</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term 
Dictionary)</td>
+<td>.tim</td>
+<td>The term dictionary, stores term info</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Index)</td>
+<td>.tip</td>
+<td>The index into the Term Dictionary</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Frequencies)</td>
+<td>.doc</td>
+<td>Contains the list of docs which contain each term along with frequency</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Positions)</td>
+<td>.pos</td>
+<td>Stores position information about where a term occurs in the index</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Payloads)</td>
+<td>.pay</td>
+<td>Stores additional per-position metadata information such as character 
offsets and user payloads</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42NormsFormat Norms)</td>
+<td>.nvd, .nvm</td>
+<td>Encodes length and boost factors for docs and fields</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42DocValuesFormat Per-Document 
Values)</td>
+<td>.dvd, .dvm</td>
+<td>Encodes additional scoring factors or other per-document information.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Index)</td>
+<td>.tvx</td>
+<td>Stores offset into the document data file</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Documents)</td>
+<td>.tvd</td>
+<td>Contains information about each document that has term vectors</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Fields)</td>
+<td>.tvf</td>
+<td>The field level info about term vectors</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40LiveDocsFormat Deleted 
Documents)</td>
+<td>.del</td>
+<td>Info about what files are deleted</td>
+</tr>
+</table>
+</div>
+
+## Lock File
+
+The write lock, which is stored in the index directory by default, is named
+"write.lock". If the lock directory is different from the index directory then
+the write lock will be named "XXXX-write.lock" where XXXX is a unique prefix
+derived from the full path to the index directory. When this file is present, a
+writer is currently modifying the index (adding or removing documents). This
+lock file ensures that only one writer is modifying the index at a time.
+
+## History
+
+Compatibility notes are provided in this document, describing how file formats 
have changed from prior versions:
+
+*   In version 2.1, the file format was changed to allow lock-less commits (ie,
+no more commit lock). The change is fully backwards compatible: you can open a
+pre-2.1 index for searching or adding/deleting of docs. When the new segments
+file is saved (committed), it will be written in the new file format (meaning
+no specific "upgrade" process is needed). But note that once a commit has
+occurred, pre-2.1 Lucene will not be able to read the index.
+*   In version 2.3, the file format was changed to allow segments to share a
+single set of doc store (vectors & stored fields) files. This allows for
+faster indexing in certain cases. The change is fully backwards compatible (in
+the same way as the lock-less commits change in 2.1).
+*   In version 2.4, Strings are now written as true UTF-8 byte sequence, not
+Java's modified UTF-8. See [
+LUCENE-510](http://issues.apache.org/jira/browse/LUCENE-510) for details.
+*   In version 2.9, an optional opaque Map<String,String> CommitUserData
+may be passed to IndexWriter's commit methods (and later retrieved), which is
+recorded in the segments_N file. See [
+LUCENE-1382](http://issues.apache.org/jira/browse/LUCENE-1382) for details. 
Also,
+diagnostics were added to each segment written recording details about why it
+was written (due to flush, merge; which OS/JRE was used; etc.). See issue
+[LUCENE-1654](http://issues.apache.org/jira/browse/LUCENE-1654) for details.
+*   In version 3.0, compressed fields are no longer written to the index (they
+can still be read, but on merge the new segment will write them, uncompressed).
+See issue [LUCENE-1960](http://issues.apache.org/jira/browse/LUCENE-1960) 
+for details.
+*   In version 3.1, segments records the code version that created them. See
+[LUCENE-2720](http://issues.apache.org/jira/browse/LUCENE-2720) for details. 
+Additionally segments track explicitly whether or not they have term vectors. 
+See [LUCENE-2811](http://issues.apache.org/jira/browse/LUCENE-2811) 
+for details.
+*   In version 3.2, numeric fields are written as natively to stored fields
+file, previously they were stored in text format only.
+*   In version 3.4, fields can omit position data while still indexing term
+frequencies.
+*   In version 4.0, the format of the inverted index became extensible via
+the [](xref:Lucene.Net.Codecs.Codec Codec) api. Fast per-document storage
+({@code DocValues}) was introduced. Normalization factors need no longer be a 
+single byte, they can be any [](xref:Lucene.Net.Index.NumericDocValues 
NumericDocValues). 
+Terms need not be unicode strings, they can be any byte sequence. Term offsets 
+can optionally be indexed into the postings lists. Payloads can be stored in 
the 
+term vectors.
+*   In version 4.1, the format of the postings list changed to use either
+of FOR compression or variable-byte encoding, depending upon the frequency
+of the term. Terms appearing only once were changed to inline directly into
+the term dictionary. Stored fields are compressed by default. 
+*   In version 4.2, term vectors are compressed by default. DocValues has 
+a new multi-valued type (SortedSet), that can be used for 
faceting/grouping/joining
+on multi-valued fields.
+
+## Limitations
+
+<div>
+
+Lucene uses a Java `int` to refer to document numbers, and the index file 
format uses an `Int32` on-disk to store document numbers. This is a limitation 
of both the index file format and the current implementation. Eventually these 
should be replaced with either `UInt64` values, or better yet, 
[](xref:Lucene.Net.Store.DataOutput.WriteVInt VInt) values which have no limit.
+
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Codecs/Lucene45/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Lucene45/package.md 
b/src/Lucene.Net/Codecs/Lucene45/package.md
new file mode 100644
index 0000000..7ca94f4
--- /dev/null
+++ b/src/Lucene.Net/Codecs/Lucene45/package.md
@@ -0,0 +1,350 @@
+
+<!--
+ 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.
+-->
+
+Lucene 4.5 file format.
+
+# Apache Lucene - Index File Formats
+
+<div>
+
+*   [Introduction](#Introduction)
+*   [Definitions](#Definitions)
+
+    *   [Inverted Indexing](#Inverted_Indexing)
+    *   [Types of Fields](#Types_of_Fields)
+    *   [Segments](#Segments)
+    *   [Document Numbers](#Document_Numbers)
+
+*   [Index Structure Overview](#Overview)
+*   [File Naming](#File_Naming)
+*   [Summary of File Extensions](#file-names)
+*   *   [Lock File](#Lock_File)
+    *   [History](#History)
+    *   [Limitations](#Limitations)
+
+</div>
+
+## Introduction
+
+<div>
+
+This document defines the index file formats used in this version of Lucene. 
If you are using a different version of Lucene, please consult the copy of 
`docs/` that was distributed with the version you are using.
+
+Apache Lucene is written in Java, but several efforts are underway to write 
[versions of Lucene in other programming 
languages](http://wiki.apache.org/lucene-java/LuceneImplementations). If these 
versions are to remain compatible with Apache Lucene, then a 
language-independent definition of the Lucene index format is required. This 
document thus attempts to provide a complete and independent definition of the 
Apache Lucene file formats.
+
+As Lucene evolves, this document should evolve. Versions of Lucene in 
different programming languages should endeavor to agree on file formats, and 
generate new versions of this document.
+
+</div>
+
+## Definitions
+
+<div>
+
+The fundamental concepts in Lucene are index, document, field and term.
+
+An index contains a sequence of documents.
+
+*   A document is a sequence of fields.
+*   A field is a named sequence of terms.
+*   A term is a sequence of bytes.
+
+The same sequence of bytes in two different fields is considered a different 
term. Thus terms are represented as a pair: the string naming the field, and 
the bytes within the field.
+
+### Inverted Indexing
+
+The index stores statistics about terms in order to make term-based search 
more efficient. Lucene's index falls into the family of indexes known as an 
*inverted index.* This is because it can list, for a term, the documents that 
contain it. This is the inverse of the natural relationship, in which documents 
list terms.
+
+### Types of Fields
+
+In Lucene, fields may be *stored*, in which case their text is stored in the 
index literally, in a non-inverted manner. Fields that are inverted are called 
*indexed*. A field may be both stored and indexed.
+
+The text of a field may be *tokenized* into terms to be indexed, or the text 
of a field may be used literally as a term to be indexed. Most fields are 
tokenized, but sometimes it is useful for certain identifier fields to be 
indexed literally.
+
+See the [](xref:Lucene.Net.Documents.Field Field) java docs for more 
information on Fields.
+
+### Segments
+
+Lucene indexes may be composed of multiple sub-indexes, or *segments*. Each 
segment is a fully independent index, which could be searched separately. 
Indexes evolve by:
+
+1.  Creating new segments for newly added documents.
+2.  Merging existing segments.
+
+Searches may involve multiple segments and/or multiple indexes, each index 
potentially composed of a set of segments.
+
+### Document Numbers
+
+Internally, Lucene refers to documents by an integer *document number*. The 
first document added to an index is numbered zero, and each subsequent document 
added gets a number one greater than the previous.
+
+Note that a document's number may change, so caution should be taken when 
storing these numbers outside of Lucene. In particular, numbers may change in 
the following situations:
+
+*   
+
+The numbers stored in each segment are unique only within the segment, and 
must be converted before they can be used in a larger context. The standard 
technique is to allocate each segment a range of values, based on the range of 
numbers used in that segment. To convert a document number from a segment to an 
external value, the segment's *base* document number is added. To convert an 
external value back to a segment-specific value, the segment is identified by 
the range that the external value is in, and the segment's base value is 
subtracted. For example two five document segments might be combined, so that 
the first segment has a base value of zero, and the second of five. Document 
three from the second segment would have an external value of eight.
+
+*   
+
+When documents are deleted, gaps are created in the numbering. These are 
eventually removed as the index evolves through merging. Deleted documents are 
dropped when segments are merged. A freshly-merged segment thus has no gaps in 
its numbering.
+
+</div>
+
+## Index Structure Overview
+
+<div>
+
+Each segment index maintains the following:
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40SegmentInfoFormat Segment info).
+   This contains metadata about a segment, such as the number of documents,
+   what files it uses, 
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42FieldInfosFormat Field names). 
+   This contains the set of field names used in the index.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Stored Field 
values). 
+This contains, for each document, a list of attribute-value pairs, where the 
attributes 
+are field names. These are used to store auxiliary information about the 
document, such as 
+its title, url, or an identifier to access a database. The set of stored 
fields are what is 
+returned for each hit when searching. This is keyed by document number.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term 
dictionary). 
+A dictionary containing all of the terms used in all of the
+indexed fields of all of the documents. The dictionary also contains the number
+of documents which contain the term, and pointers to the term's frequency and
+proximity data.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Frequency 
data). 
+For each term in the dictionary, the numbers of all the
+documents that contain that term, and the frequency of the term in that
+document, unless frequencies are omitted (IndexOptions.DOCS_ONLY)
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Proximity 
data). 
+For each term in the dictionary, the positions that the
+term occurs in each document. Note that this will not exist if all fields in
+all documents omit position data.
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42NormsFormat Normalization 
factors). 
+For each field in each document, a value is stored
+that is multiplied into the score for hits on that field.
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term 
Vectors). 
+For each field in each document, the term vector (sometimes
+called document vector) may be stored. A term vector consists of term text and
+term frequency. To add Term Vectors to your index see the 
+[](xref:Lucene.Net.Documents.Field Field) constructors
+
+*   [](xref:Lucene.Net.Codecs.Lucene45.Lucene45DocValuesFormat Per-document 
values). 
+Like stored values, these are also keyed by document
+number, but are generally intended to be loaded into main memory for fast
+access. Whereas stored values are generally intended for summary results from
+searches, per-document values are useful for things like scoring factors.
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40LiveDocsFormat Deleted 
documents). 
+An optional file indicating which documents are deleted.
+
+Details on each of these are provided in their linked pages.
+
+</div>
+
+## File Naming
+
+<div>
+
+All files belonging to a segment have the same name with varying extensions. 
The extensions correspond to the different file formats described below. When 
using the Compound File format (default in 1.4 and greater) these files (except 
for the Segment info file, the Lock file, and Deleted documents file) are 
collapsed into a single .cfs file (see below for details)
+
+Typically, all segments in an index are stored in a single directory, although 
this is not required.
+
+As of version 2.1 (lock-less commits), file names are never re-used (there is 
one exception, "segments.gen", see below). That is, when any file is saved to 
the Directory it is given a never before used filename. This is achieved using 
a simple generations approach. For example, the first segments file is 
segments_1, then segments_2, etc. The generation is a sequential long integer 
represented in alpha-numeric (base 36) form.
+
+</div>
+
+## Summary of File Extensions
+
+<div>
+
+The following table summarizes the names and extensions of the files in Lucene:
+
+<table cellspacing="1" cellpadding="4">
+<tr>
+<th>Name</th>
+<th>Extension</th>
+<th>Brief Description</th>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Index.SegmentInfos Segments File)</td>
+<td>segments.gen, segments_N</td>
+<td>Stores information about a commit point</td>
+</tr>
+<tr>
+<td>[Lock File](#Lock_File)</td>
+<td>write.lock</td>
+<td>The Write lock prevents multiple IndexWriters from writing to the same
+file.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40SegmentInfoFormat Segment 
Info)</td>
+<td>.si</td>
+<td>Stores metadata about a segment</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Store.CompoundFileDirectory Compound File)</td>
+<td>.cfs, .cfe</td>
+<td>An optional "virtual" file consisting of all the other index files for
+systems that frequently run out of file handles.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42FieldInfosFormat Fields)</td>
+<td>.fnm</td>
+<td>Stores information about the fields</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Field 
Index)</td>
+<td>.fdx</td>
+<td>Contains pointers to field data</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Field 
Data)</td>
+<td>.fdt</td>
+<td>The stored fields for documents</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term 
Dictionary)</td>
+<td>.tim</td>
+<td>The term dictionary, stores term info</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Index)</td>
+<td>.tip</td>
+<td>The index into the Term Dictionary</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Frequencies)</td>
+<td>.doc</td>
+<td>Contains the list of docs which contain each term along with frequency</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Positions)</td>
+<td>.pos</td>
+<td>Stores position information about where a term occurs in the index</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Payloads)</td>
+<td>.pay</td>
+<td>Stores additional per-position metadata information such as character 
offsets and user payloads</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42NormsFormat Norms)</td>
+<td>.nvd, .nvm</td>
+<td>Encodes length and boost factors for docs and fields</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene45.Lucene45DocValuesFormat Per-Document 
Values)</td>
+<td>.dvd, .dvm</td>
+<td>Encodes additional scoring factors or other per-document information.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Index)</td>
+<td>.tvx</td>
+<td>Stores offset into the document data file</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Documents)</td>
+<td>.tvd</td>
+<td>Contains information about each document that has term vectors</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Fields)</td>
+<td>.tvf</td>
+<td>The field level info about term vectors</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40LiveDocsFormat Deleted 
Documents)</td>
+<td>.del</td>
+<td>Info about what files are deleted</td>
+</tr>
+</table>
+</div>
+
+## Lock File
+
+The write lock, which is stored in the index directory by default, is named
+"write.lock". If the lock directory is different from the index directory then
+the write lock will be named "XXXX-write.lock" where XXXX is a unique prefix
+derived from the full path to the index directory. When this file is present, a
+writer is currently modifying the index (adding or removing documents). This
+lock file ensures that only one writer is modifying the index at a time.
+
+## History
+
+Compatibility notes are provided in this document, describing how file formats 
have changed from prior versions:
+
+*   In version 2.1, the file format was changed to allow lock-less commits (ie,
+no more commit lock). The change is fully backwards compatible: you can open a
+pre-2.1 index for searching or adding/deleting of docs. When the new segments
+file is saved (committed), it will be written in the new file format (meaning
+no specific "upgrade" process is needed). But note that once a commit has
+occurred, pre-2.1 Lucene will not be able to read the index.
+*   In version 2.3, the file format was changed to allow segments to share a
+single set of doc store (vectors & stored fields) files. This allows for
+faster indexing in certain cases. The change is fully backwards compatible (in
+the same way as the lock-less commits change in 2.1).
+*   In version 2.4, Strings are now written as true UTF-8 byte sequence, not
+Java's modified UTF-8. See [
+LUCENE-510](http://issues.apache.org/jira/browse/LUCENE-510) for details.
+*   In version 2.9, an optional opaque Map<String,String> CommitUserData
+may be passed to IndexWriter's commit methods (and later retrieved), which is
+recorded in the segments_N file. See [
+LUCENE-1382](http://issues.apache.org/jira/browse/LUCENE-1382) for details. 
Also,
+diagnostics were added to each segment written recording details about why it
+was written (due to flush, merge; which OS/JRE was used; etc.). See issue
+[LUCENE-1654](http://issues.apache.org/jira/browse/LUCENE-1654) for details.
+*   In version 3.0, compressed fields are no longer written to the index (they
+can still be read, but on merge the new segment will write them, uncompressed).
+See issue [LUCENE-1960](http://issues.apache.org/jira/browse/LUCENE-1960) 
+for details.
+*   In version 3.1, segments records the code version that created them. See
+[LUCENE-2720](http://issues.apache.org/jira/browse/LUCENE-2720) for details. 
+Additionally segments track explicitly whether or not they have term vectors. 
+See [LUCENE-2811](http://issues.apache.org/jira/browse/LUCENE-2811) 
+for details.
+*   In version 3.2, numeric fields are written as natively to stored fields
+file, previously they were stored in text format only.
+*   In version 3.4, fields can omit position data while still indexing term
+frequencies.
+*   In version 4.0, the format of the inverted index became extensible via
+the [](xref:Lucene.Net.Codecs.Codec Codec) api. Fast per-document storage
+({@code DocValues}) was introduced. Normalization factors need no longer be a 
+single byte, they can be any [](xref:Lucene.Net.Index.NumericDocValues 
NumericDocValues). 
+Terms need not be unicode strings, they can be any byte sequence. Term offsets 
+can optionally be indexed into the postings lists. Payloads can be stored in 
the 
+term vectors.
+*   In version 4.1, the format of the postings list changed to use either
+of FOR compression or variable-byte encoding, depending upon the frequency
+of the term. Terms appearing only once were changed to inline directly into
+the term dictionary. Stored fields are compressed by default. 
+*   In version 4.2, term vectors are compressed by default. DocValues has 
+a new multi-valued type (SortedSet), that can be used for 
faceting/grouping/joining
+on multi-valued fields.
+*   In version 4.5, DocValues were extended to explicitly represent missing 
values.
+
+## Limitations
+
+<div>
+
+Lucene uses a Java `int` to refer to document numbers, and the index file 
format uses an `Int32` on-disk to store document numbers. This is a limitation 
of both the index file format and the current implementation. Eventually these 
should be replaced with either `UInt64` values, or better yet, 
[](xref:Lucene.Net.Store.DataOutput.WriteVInt VInt) values which have no limit.
+
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Codecs/Lucene46/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Lucene46/package.md 
b/src/Lucene.Net/Codecs/Lucene46/package.md
new file mode 100644
index 0000000..8923857
--- /dev/null
+++ b/src/Lucene.Net/Codecs/Lucene46/package.md
@@ -0,0 +1,355 @@
+
+<!--
+ 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.
+-->
+
+Lucene 4.6 file format.
+
+# Apache Lucene - Index File Formats
+
+<div>
+
+*   [Introduction](#Introduction)
+*   [Definitions](#Definitions)
+
+    *   [Inverted Indexing](#Inverted_Indexing)
+    *   [Types of Fields](#Types_of_Fields)
+    *   [Segments](#Segments)
+    *   [Document Numbers](#Document_Numbers)
+
+*   [Index Structure Overview](#Overview)
+*   [File Naming](#File_Naming)
+*   [Summary of File Extensions](#file-names)
+*   *   [Lock File](#Lock_File)
+    *   [History](#History)
+    *   [Limitations](#Limitations)
+
+</div>
+
+## Introduction
+
+<div>
+
+This document defines the index file formats used in this version of Lucene. 
If you are using a different version of Lucene, please consult the copy of 
`docs/` that was distributed with the version you are using.
+
+Apache Lucene is written in Java, but several efforts are underway to write 
[versions of Lucene in other programming 
languages](http://wiki.apache.org/lucene-java/LuceneImplementations). If these 
versions are to remain compatible with Apache Lucene, then a 
language-independent definition of the Lucene index format is required. This 
document thus attempts to provide a complete and independent definition of the 
Apache Lucene file formats.
+
+As Lucene evolves, this document should evolve. Versions of Lucene in 
different programming languages should endeavor to agree on file formats, and 
generate new versions of this document.
+
+</div>
+
+## Definitions
+
+<div>
+
+The fundamental concepts in Lucene are index, document, field and term.
+
+An index contains a sequence of documents.
+
+*   A document is a sequence of fields.
+*   A field is a named sequence of terms.
+*   A term is a sequence of bytes.
+
+The same sequence of bytes in two different fields is considered a different 
term. Thus terms are represented as a pair: the string naming the field, and 
the bytes within the field.
+
+### Inverted Indexing
+
+The index stores statistics about terms in order to make term-based search 
more efficient. Lucene's index falls into the family of indexes known as an 
*inverted index.* This is because it can list, for a term, the documents that 
contain it. This is the inverse of the natural relationship, in which documents 
list terms.
+
+### Types of Fields
+
+In Lucene, fields may be *stored*, in which case their text is stored in the 
index literally, in a non-inverted manner. Fields that are inverted are called 
*indexed*. A field may be both stored and indexed.
+
+The text of a field may be *tokenized* into terms to be indexed, or the text 
of a field may be used literally as a term to be indexed. Most fields are 
tokenized, but sometimes it is useful for certain identifier fields to be 
indexed literally.
+
+See the [](xref:Lucene.Net.Documents.Field Field) java docs for more 
information on Fields.
+
+### Segments
+
+Lucene indexes may be composed of multiple sub-indexes, or *segments*. Each 
segment is a fully independent index, which could be searched separately. 
Indexes evolve by:
+
+1.  Creating new segments for newly added documents.
+2.  Merging existing segments.
+
+Searches may involve multiple segments and/or multiple indexes, each index 
potentially composed of a set of segments.
+
+### Document Numbers
+
+Internally, Lucene refers to documents by an integer *document number*. The 
first document added to an index is numbered zero, and each subsequent document 
added gets a number one greater than the previous.
+
+Note that a document's number may change, so caution should be taken when 
storing these numbers outside of Lucene. In particular, numbers may change in 
the following situations:
+
+*   
+
+The numbers stored in each segment are unique only within the segment, and 
must be converted before they can be used in a larger context. The standard 
technique is to allocate each segment a range of values, based on the range of 
numbers used in that segment. To convert a document number from a segment to an 
external value, the segment's *base* document number is added. To convert an 
external value back to a segment-specific value, the segment is identified by 
the range that the external value is in, and the segment's base value is 
subtracted. For example two five document segments might be combined, so that 
the first segment has a base value of zero, and the second of five. Document 
three from the second segment would have an external value of eight.
+
+*   
+
+When documents are deleted, gaps are created in the numbering. These are 
eventually removed as the index evolves through merging. Deleted documents are 
dropped when segments are merged. A freshly-merged segment thus has no gaps in 
its numbering.
+
+</div>
+
+## Index Structure Overview
+
+<div>
+
+Each segment index maintains the following:
+
+*   [](xref:Lucene.Net.Codecs.Lucene46.Lucene46SegmentInfoFormat Segment info).
+   This contains metadata about a segment, such as the number of documents,
+   what files it uses, 
+
+*   [](xref:Lucene.Net.Codecs.Lucene46.Lucene46FieldInfosFormat Field names). 
+   This contains the set of field names used in the index.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Stored Field 
values). 
+This contains, for each document, a list of attribute-value pairs, where the 
attributes 
+are field names. These are used to store auxiliary information about the 
document, such as 
+its title, url, or an identifier to access a database. The set of stored 
fields are what is 
+returned for each hit when searching. This is keyed by document number.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term 
dictionary). 
+A dictionary containing all of the terms used in all of the
+indexed fields of all of the documents. The dictionary also contains the number
+of documents which contain the term, and pointers to the term's frequency and
+proximity data.
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Frequency 
data). 
+For each term in the dictionary, the numbers of all the
+documents that contain that term, and the frequency of the term in that
+document, unless frequencies are omitted (IndexOptions.DOCS_ONLY)
+
+*   [](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Proximity 
data). 
+For each term in the dictionary, the positions that the
+term occurs in each document. Note that this will not exist if all fields in
+all documents omit position data.
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42NormsFormat Normalization 
factors). 
+For each field in each document, a value is stored
+that is multiplied into the score for hits on that field.
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term 
Vectors). 
+For each field in each document, the term vector (sometimes
+called document vector) may be stored. A term vector consists of term text and
+term frequency. To add Term Vectors to your index see the 
+[](xref:Lucene.Net.Documents.Field Field) constructors
+
+*   [](xref:Lucene.Net.Codecs.Lucene42.Lucene42DocValuesFormat Per-document 
values). 
+Like stored values, these are also keyed by document
+number, but are generally intended to be loaded into main memory for fast
+access. Whereas stored values are generally intended for summary results from
+searches, per-document values are useful for things like scoring factors.
+
+*   [](xref:Lucene.Net.Codecs.Lucene40.Lucene40LiveDocsFormat Deleted 
documents). 
+An optional file indicating which documents are deleted.
+
+Details on each of these are provided in their linked pages.
+
+</div>
+
+## File Naming
+
+<div>
+
+All files belonging to a segment have the same name with varying extensions. 
The extensions correspond to the different file formats described below. When 
using the Compound File format (default in 1.4 and greater) these files (except 
for the Segment info file, the Lock file, and Deleted documents file) are 
collapsed into a single .cfs file (see below for details)
+
+Typically, all segments in an index are stored in a single directory, although 
this is not required.
+
+As of version 2.1 (lock-less commits), file names are never re-used (there is 
one exception, "segments.gen", see below). That is, when any file is saved to 
the Directory it is given a never before used filename. This is achieved using 
a simple generations approach. For example, the first segments file is 
segments_1, then segments_2, etc. The generation is a sequential long integer 
represented in alpha-numeric (base 36) form.
+
+</div>
+
+## Summary of File Extensions
+
+<div>
+
+The following table summarizes the names and extensions of the files in Lucene:
+
+<table cellspacing="1" cellpadding="4">
+<tr>
+<th>Name</th>
+<th>Extension</th>
+<th>Brief Description</th>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Index.SegmentInfos Segments File)</td>
+<td>segments.gen, segments_N</td>
+<td>Stores information about a commit point</td>
+</tr>
+<tr>
+<td>[Lock File](#Lock_File)</td>
+<td>write.lock</td>
+<td>The Write lock prevents multiple IndexWriters from writing to the same
+file.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40SegmentInfoFormat Segment 
Info)</td>
+<td>.si</td>
+<td>Stores metadata about a segment</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Store.CompoundFileDirectory Compound File)</td>
+<td>.cfs, .cfe</td>
+<td>An optional "virtual" file consisting of all the other index files for
+systems that frequently run out of file handles.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene46.Lucene46FieldInfosFormat Fields)</td>
+<td>.fnm</td>
+<td>Stores information about the fields</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Field 
Index)</td>
+<td>.fdx</td>
+<td>Contains pointers to field data</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41StoredFieldsFormat Field 
Data)</td>
+<td>.fdt</td>
+<td>The stored fields for documents</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term 
Dictionary)</td>
+<td>.tim</td>
+<td>The term dictionary, stores term info</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Term Index)</td>
+<td>.tip</td>
+<td>The index into the Term Dictionary</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Frequencies)</td>
+<td>.doc</td>
+<td>Contains the list of docs which contain each term along with frequency</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Positions)</td>
+<td>.pos</td>
+<td>Stores position information about where a term occurs in the index</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene41.Lucene41PostingsFormat Payloads)</td>
+<td>.pay</td>
+<td>Stores additional per-position metadata information such as character 
offsets and user payloads</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42NormsFormat Norms)</td>
+<td>.nvd, .nvm</td>
+<td>Encodes length and boost factors for docs and fields</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42DocValuesFormat Per-Document 
Values)</td>
+<td>.dvd, .dvm</td>
+<td>Encodes additional scoring factors or other per-document information.</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Index)</td>
+<td>.tvx</td>
+<td>Stores offset into the document data file</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Documents)</td>
+<td>.tvd</td>
+<td>Contains information about each document that has term vectors</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene42.Lucene42TermVectorsFormat Term Vector 
Fields)</td>
+<td>.tvf</td>
+<td>The field level info about term vectors</td>
+</tr>
+<tr>
+<td>[](xref:Lucene.Net.Codecs.Lucene40.Lucene40LiveDocsFormat Deleted 
Documents)</td>
+<td>.del</td>
+<td>Info about what files are deleted</td>
+</tr>
+</table>
+</div>
+
+## Lock File
+
+The write lock, which is stored in the index directory by default, is named
+"write.lock". If the lock directory is different from the index directory then
+the write lock will be named "XXXX-write.lock" where XXXX is a unique prefix
+derived from the full path to the index directory. When this file is present, a
+writer is currently modifying the index (adding or removing documents). This
+lock file ensures that only one writer is modifying the index at a time.
+
+## History
+
+Compatibility notes are provided in this document, describing how file formats 
have changed from prior versions:
+
+*   In version 2.1, the file format was changed to allow lock-less commits (ie,
+no more commit lock). The change is fully backwards compatible: you can open a
+pre-2.1 index for searching or adding/deleting of docs. When the new segments
+file is saved (committed), it will be written in the new file format (meaning
+no specific "upgrade" process is needed). But note that once a commit has
+occurred, pre-2.1 Lucene will not be able to read the index.
+*   In version 2.3, the file format was changed to allow segments to share a
+single set of doc store (vectors & stored fields) files. This allows for
+faster indexing in certain cases. The change is fully backwards compatible (in
+the same way as the lock-less commits change in 2.1).
+*   In version 2.4, Strings are now written as true UTF-8 byte sequence, not
+Java's modified UTF-8. See [
+LUCENE-510](http://issues.apache.org/jira/browse/LUCENE-510) for details.
+*   In version 2.9, an optional opaque Map<String,String> CommitUserData
+may be passed to IndexWriter's commit methods (and later retrieved), which is
+recorded in the segments_N file. See [
+LUCENE-1382](http://issues.apache.org/jira/browse/LUCENE-1382) for details. 
Also,
+diagnostics were added to each segment written recording details about why it
+was written (due to flush, merge; which OS/JRE was used; etc.). See issue
+[LUCENE-1654](http://issues.apache.org/jira/browse/LUCENE-1654) for details.
+*   In version 3.0, compressed fields are no longer written to the index (they
+can still be read, but on merge the new segment will write them, uncompressed).
+See issue [LUCENE-1960](http://issues.apache.org/jira/browse/LUCENE-1960) 
+for details.
+*   In version 3.1, segments records the code version that created them. See
+[LUCENE-2720](http://issues.apache.org/jira/browse/LUCENE-2720) for details. 
+Additionally segments track explicitly whether or not they have term vectors. 
+See [LUCENE-2811](http://issues.apache.org/jira/browse/LUCENE-2811) 
+for details.
+*   In version 3.2, numeric fields are written as natively to stored fields
+file, previously they were stored in text format only.
+*   In version 3.4, fields can omit position data while still indexing term
+frequencies.
+*   In version 4.0, the format of the inverted index became extensible via
+the [](xref:Lucene.Net.Codecs.Codec Codec) api. Fast per-document storage
+({@code DocValues}) was introduced. Normalization factors need no longer be a 
+single byte, they can be any [](xref:Lucene.Net.Index.NumericDocValues 
NumericDocValues). 
+Terms need not be unicode strings, they can be any byte sequence. Term offsets 
+can optionally be indexed into the postings lists. Payloads can be stored in 
the 
+term vectors.
+*   In version 4.1, the format of the postings list changed to use either
+of FOR compression or variable-byte encoding, depending upon the frequency
+of the term. Terms appearing only once were changed to inline directly into
+the term dictionary. Stored fields are compressed by default. 
+*   In version 4.2, term vectors are compressed by default. DocValues has 
+a new multi-valued type (SortedSet), that can be used for 
faceting/grouping/joining
+on multi-valued fields.
+*   In version 4.5, DocValues were extended to explicitly represent missing 
values.
+*   In version 4.6, FieldInfos were extended to support per-field DocValues 
generation, to 
+allow updating NumericDocValues fields.
+*   In version 4.8, checksum footers were added to the end of each index file 
+for improved data integrity. Specifically, the last 8 bytes of every index file
+contain the zlib-crc32 checksum of the file.
+
+## Limitations
+
+<div>
+
+Lucene uses a Java `int` to refer to document numbers, and the index file 
format uses an `Int32` on-disk to store document numbers. This is a limitation 
of both the index file format and the current implementation. Eventually these 
should be replaced with either `UInt64` values, or better yet, 
[](xref:Lucene.Net.Store.DataOutput.WriteVInt VInt) values which have no limit.
+
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Codecs/PerField/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/PerField/package.md 
b/src/Lucene.Net/Codecs/PerField/package.md
new file mode 100644
index 0000000..0621395
--- /dev/null
+++ b/src/Lucene.Net/Codecs/PerField/package.md
@@ -0,0 +1,19 @@
+
+<!--
+ 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.
+-->
+
+Postings format that can delegate to different formats per-field.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Codecs/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/package.md b/src/Lucene.Net/Codecs/package.md
new file mode 100644
index 0000000..7128d2f
--- /dev/null
+++ b/src/Lucene.Net/Codecs/package.md
@@ -0,0 +1,30 @@
+
+<!--
+ 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.
+-->
+
+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 
[](xref:Lucene.Net.Codecs.PostingsFormat) * DocValues - see 
[](xref:Lucene.Net.Codecs.DocValuesFormat) * Stored fields - see 
[](xref:Lucene.Net.Codecs.StoredFieldsFormat) * Term vectors - see 
[](xref:Lucene.Net.Codecs.TermVectorsFormat) * FieldInfos - see 
[](xref:Lucene.Net.Codecs.FieldInfosFormat) * SegmentInfo - see 
[](xref:Lucene.Net.Codecs.SegmentInfoFormat) * Norms - see 
[](xref:Lucene.Net.Codecs.NormsFormat) * Live documents - see 
[](xref:Lucene.Net.Codecs.LiveDocsFormat) 
+
+  For some concrete implementations beyond Lucene's official index format, see
+  the [Codecs module]({@docRoot}/../codecs/overview-summary.html).
+
+ Codecs are identified by name through the Java Service Provider Interface. To 
create your own codec, extend [](xref:Lucene.Net.Codecs.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 [](xref:Lucene.Net.Codecs.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 [](xref:Lucene.Net.Codecs.Lucene46.Lucene46Codec) and override 
[](xref:Lucene.Net.Codecs.Lucene46.Lucene46Codec.GetPostingsFormatForField(String))
 to return your custom postings format. 
+
+ Similarly, if you just want to customise the 
[](xref:Lucene.Net.Codecs.DocValuesFormat) per-field, have a look at 
[](xref:Lucene.Net.Codecs.Lucene46.Lucene46Codec.GetDocValuesFormatForField(String)).
 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Document/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Document/package.md 
b/src/Lucene.Net/Document/package.md
new file mode 100644
index 0000000..6ac14e0
--- /dev/null
+++ b/src/Lucene.Net/Document/package.md
@@ -0,0 +1,33 @@
+
+<!--
+ 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.
+-->
+
+The logical representation of a [](xref:Lucene.Net.Documents.Document) for 
indexing and searching.
+
+The document package provides the user level logical representation of content 
to be indexed and searched. The package also provides utilities for working 
with [](xref:Lucene.Net.Documents.Document)s and 
[](xref:Lucene.Net.Index.IndexableField)s.
+
+## Document and IndexableField
+
+A [](xref:Lucene.Net.Documents.Document) is a collection of 
[](xref:Lucene.Net.Index.IndexableField)s. A 
[](xref:Lucene.Net.Index.IndexableField) is a logical representation of a 
user's content that needs to be indexed or stored. 
[](xref:Lucene.Net.Index.IndexableField)s have a number of properties that tell 
Lucene how to treat the content (like indexed, tokenized, stored, etc.) See the 
[](xref:Lucene.Net.Documents.Field) implementation of 
[](xref:Lucene.Net.Index.IndexableField) for specifics on these properties. 
+
+Note: it is common to refer to [](xref:Lucene.Net.Documents.Document)s having 
[](xref:Lucene.Net.Documents.Field)s, even though technically they have 
[](xref:Lucene.Net.Index.IndexableField)s.
+
+## Working with Documents
+
+First and foremost, a [](xref:Lucene.Net.Documents.Document) is something 
created by the user application. It is your job to create Documents based on 
the content of the files you are working with in your application (Word, txt, 
PDF, Excel or any other format.) How this is done is completely up to you. That 
being said, there are many tools available in other projects that can make the 
process of taking a file and converting it into a Lucene 
[](xref:Lucene.Net.Documents.Document). 
+
+The [](xref:Lucene.Net.Documents.DateTools) is a utility class to make dates 
and times searchable (remember, Lucene only searches text). 
[](xref:Lucene.Net.Documents.IntField), 
[](xref:Lucene.Net.Documents.LongField), 
[](xref:Lucene.Net.Documents.FloatField) and 
[](xref:Lucene.Net.Documents.DoubleField) are a special helper class to 
simplify indexing of numeric values (and also dates) for fast range range 
queries with [](xref:Lucene.Net.Search.NumericRangeQuery) (using a special 
sortable string representation of numeric values).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Index/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/package.md b/src/Lucene.Net/Index/package.md
new file mode 100644
index 0000000..a1f0996
--- /dev/null
+++ b/src/Lucene.Net/Index/package.md
@@ -0,0 +1,71 @@
+
+<!--
+ 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.
+-->
+
+Code to maintain and access indices.
+
+## Table Of Contents
+
+ 1. [Postings APIs](#postings) * [Fields](#fields) * [Terms](#terms) * 
[Documents](#documents) * [Positions](#positions) 2. [Index Statistics](#stats) 
* [Term-level](#termstats) * [Field-level](#fieldstats) * 
[Segment-level](#segmentstats) * [Document-level](#documentstats) 
+
+## Postings APIs
+
+#### 
+    Fields
+
+ [](xref:Lucene.Net.Index.Fields) is the initial entry point into the postings 
APIs, this can be obtained in several ways: // access indexed fields for an 
index segment Fields fields = reader.fields(); // access term vector fields for 
a specified document Fields fields = reader.getTermVectors(docid); Fields 
implements Java's Iterable interface, so its easy to enumerate the list of 
fields: // enumerate list of fields for (String field : fields) { // access the 
terms for this field Terms terms = fields.terms(field); } 
+
+#### 
+    Terms
+
+ [](xref:Lucene.Net.Index.Terms) represents the collection of terms within a 
field, exposes some metadata and [statistics](#fieldstats), and an API for 
enumeration. // metadata about the field System.out.println("positions? " + 
terms.hasPositions()); System.out.println("offsets? " + terms.hasOffsets()); 
System.out.println("payloads? " + terms.hasPayloads()); // iterate through 
terms TermsEnum termsEnum = terms.iterator(null); BytesRef term = null; while 
((term = termsEnum.next()) != null) { doSomethingWith(termsEnum.term()); } 
[](xref:Lucene.Net.Index.TermsEnum) provides an iterator over the list of terms 
within a field, some [statistics](#termstats) about the term, and methods to 
access the term's [documents](#documents) and [positions](#positions). // seek 
to a specific term boolean found = termsEnum.seekExact(new BytesRef("foobar")); 
if (found) { // get the document frequency 
System.out.println(termsEnum.docFreq()); // enumerate through documents 
DocsEnum docs = termsEnum.docs(nu
 ll, null); // enumerate through documents and positions DocsAndPositionsEnum 
docsAndPositions = termsEnum.docsAndPositions(null, null); } 
+
+#### 
+    Documents
+
+ [](xref:Lucene.Net.Index.DocsEnum) is an extension of 
[](xref:Lucene.Net.Search.DocIdSetIterator)that iterates over the list of 
documents for a term, along with the term frequency within that document. int 
docid; while ((docid = docsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) { 
System.out.println(docid); System.out.println(docsEnum.freq()); } 
+
+#### 
+    Positions
+
+ [](xref:Lucene.Net.Index.DocsAndPositionsEnum) is an extension of 
[](xref:Lucene.Net.Index.DocsEnum) that additionally allows iteration of the 
positions a term occurred within the document, and any additional per-position 
information (offsets and payload) int docid; while ((docid = 
docsAndPositionsEnum.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) { 
System.out.println(docid); int freq = docsAndPositionsEnum.freq(); for (int i = 
0; i < freq;="" i++)="" {="" 
system.out.println(docsandpositionsenum.nextposition());="" 
system.out.println(docsandpositionsenum.startoffset());="" 
system.out.println(docsandpositionsenum.endoffset());="" 
system.out.println(docsandpositionsenum.getpayload());="" }="" }=""> 
+
+## Index Statistics
+
+#### 
+    Term statistics
+
+ * [](xref:Lucene.Net.Index.TermsEnum.DocFreq): Returns the number of 
documents that contain at least one occurrence of the term. This statistic is 
always available for an indexed term. Note that it will also count deleted 
documents, when segments are merged the statistic is updated as those deleted 
documents are merged away. [](xref:Lucene.Net.Index.TermsEnum.TotalTermFreq): 
Returns the number of occurrences of this term across all documents. Note that 
this statistic is unavailable (returns `-1`) if term frequencies were omitted 
from the index ([](xref:Lucene.Net.Index.FieldInfo.IndexOptions.DOCS_ONLY 
DOCS_ONLY)) for the field. Like docFreq(), it will also count occurrences that 
appear in deleted documents. 
+
+#### 
+    Field statistics
+
+ * [](xref:Lucene.Net.Index.Terms.Size): Returns the number of unique terms in 
the field. This statistic may be unavailable (returns `-1`) for some Terms 
implementations such as [](xref:Lucene.Net.Index.MultiTerms), where it cannot 
be efficiently computed. Note that this count also includes terms that appear 
only in deleted documents: when segments are merged such terms are also merged 
away and the statistic is then updated. 
[](xref:Lucene.Net.Index.Terms.GetDocCount): Returns the number of documents 
that contain at least one occurrence of any term for this field. This can be 
thought of as a Field-level docFreq(). Like docFreq() it will also count 
deleted documents. [](xref:Lucene.Net.Index.Terms.GetSumDocFreq): Returns the 
number of postings (term-document mappings in the inverted index) for the 
field. This can be thought of as the sum of 
[](xref:Lucene.Net.Index.TermsEnum.DocFreq) across all terms in the field, and 
like docFreq() it will also count postings that appear in deleted 
 documents. [](xref:Lucene.Net.Index.Terms.GetSumTotalTermFreq): Returns the 
number of tokens for the field. This can be thought of as the sum of 
[](xref:Lucene.Net.Index.TermsEnum.TotalTermFreq) across all terms in the 
field, and like totalTermFreq() it will also count occurrences that appear in 
deleted documents, and will be unavailable (returns `-1`) if term frequencies 
were omitted from the index 
([](xref:Lucene.Net.Index.FieldInfo.IndexOptions.DOCS_ONLY DOCS_ONLY)) for the 
field. 
+
+#### 
+    Segment statistics
+
+ * [](xref:Lucene.Net.Index.IndexReader.MaxDoc): Returns the number of 
documents (including deleted documents) in the index. 
[](xref:Lucene.Net.Index.IndexReader.NumDocs): Returns the number of live 
documents (excluding deleted documents) in the index. 
[](xref:Lucene.Net.Index.IndexReader.NumDeletedDocs): Returns the number of 
deleted documents in the index. [](xref:Lucene.Net.Index.Fields.Size): Returns 
the number of indexed fields. 
[](xref:Lucene.Net.Index.Fields.GetUniqueTermCount): Returns the number of 
indexed terms, the sum of [](xref:Lucene.Net.Index.Terms.Size) across all 
fields. 
+
+#### 
+    Document statistics
+
+ Document statistics are available during the indexing process for an indexed 
field: typically a [](xref:Lucene.Net.Search.Similarities.Similarity) 
implementation will store some of these values (possibly in a lossy way), into 
the normalization value for the document in its 
[](xref:Lucene.Net.Search.Similarities.Similarity.ComputeNorm) method. 
+
+ * [](xref:Lucene.Net.Index.FieldInvertState.GetLength): Returns the number of 
tokens for this field in the document. Note that this is just the number of 
times that [](xref:Lucene.Net.Analysis.TokenStream.IncrementToken) returned 
true, and is unrelated to the values in 
[](xref:Lucene.Net.Analysis.TokenAttributes.PositionIncrementAttribute). 
[](xref:Lucene.Net.Index.FieldInvertState.GetNumOverlap): Returns the number of 
tokens for this field in the document that had a position increment of zero. 
This can be used to compute a document length that discounts artificial tokens 
such as synonyms. [](xref:Lucene.Net.Index.FieldInvertState.GetPosition): 
Returns the accumulated position value for this field in the document: computed 
from the values of 
[](xref:Lucene.Net.Analysis.TokenAttributes.PositionIncrementAttribute) and 
including [](xref:Lucene.Net.Analysis.Analyzer.GetPositionIncrementGap)s across 
multivalued fields. [](xref:Lucene.Net.Index.FieldInvertState.GetOffset): 
Returns the to
 tal character offset value for this field in the document: computed from the 
values of [](xref:Lucene.Net.Analysis.TokenAttributes.OffsetAttribute) returned 
by [](xref:Lucene.Net.Analysis.TokenStream.End), and including 
[](xref:Lucene.Net.Analysis.Analyzer.GetOffsetGap)s across multivalued fields. 
[](xref:Lucene.Net.Index.FieldInvertState.GetUniqueTermCount): Returns the 
number of unique terms encountered for this field in the document. 
[](xref:Lucene.Net.Index.FieldInvertState.GetMaxTermFrequency): Returns the 
maximum frequency across all unique terms encountered for this field in the 
document. 
+
+ Additional user-supplied statistics can be added to the document as DocValues 
fields and accessed via 
[](xref:Lucene.Net.Index.AtomicReader.GetNumericDocValues). 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/6a95ad43/src/Lucene.Net/Search/Payloads/package.md
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Search/Payloads/package.md 
b/src/Lucene.Net/Search/Payloads/package.md
new file mode 100644
index 0000000..998c3b5
--- /dev/null
+++ b/src/Lucene.Net/Search/Payloads/package.md
@@ -0,0 +1,27 @@
+<html>
+<!--
+ 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.
+-->
+<head>
+    <title>org.apache.lucene.search.payloads</title>
+</head>
+<body>
+The payloads package provides Query mechanisms for finding and using payloads.
+
+ The following Query implementations are provided: 1. 
[](xref:Lucene.Net.Search.Payloads.PayloadTermQuery PayloadTermQuery) -- Boost 
a term's score based on the value of the payload located at that term. 2. 
[](xref:Lucene.Net.Search.Payloads.PayloadNearQuery PayloadNearQuery) -- A 
[](xref:Lucene.Net.Search.Spans.SpanNearQuery SpanNearQuery) that factors in 
the value of the payloads located at each of the positions where the spans 
occur. 
+
+</body>
+</html>
\ No newline at end of file

Reply via email to