1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Writing the Lucene 4.7.2 `oakCodec` composition.
//!
//! The specification is `docs/analysis/lucene-4-7-codec.md`, extracted from
//! the Lucene sources `oak-lucene` vendors at the pinned Oak commit. Every
//! module below cites the section it implements and the Java it was read
//! from.
//!
//! **Public, because this plan's tests are separate crates.** Plan 0007 gives
//! the reason for `writer::index`, and it holds here: a vector test that
//! replays Lucene's own bytes has to reach the writer it is checking, and an
//! integration test is a different crate.
//!
//! # What this composition is
//!
//! The eight formats `OakCodec`'s constructor sets: `Lucene41` postings and
//! `Lucene45` doc values selected by name — flat, where `Lucene46Codec`
//! selects both per field — `Lucene46` field infos and segment info,
//! `Lucene42` norms and term vectors, `Lucene40` live docs, and
//! **uncompressed `Lucene40` stored fields** where `Lucene46Codec`'s own are
//! LZ4-compressed. It is not `Lucene46` with one format replaced, and §3.4
//! of the specification carries the disassembly.
//!
//! Oak selects it for a fulltext-enabled definition; every other definition
//! takes plain `Lucene46`. Which files a segment carries, and which of them
//! go inside the compound file, is §3 and §9 of the specification.
//!
//! # What it deliberately does not do
//!
//! **No merging and no deletions.** froe writes one segment and never merges
//! it; a deletions file is a file the commit *references* — plan 0008's
//! transport moves it — and not one froe writes. The feasibility verdict
//! records both as out of scope, and nothing in the consumer needs them.
// The later tasks of plan 0009 own these. Each is declared here so the
// module tree is the one the specification describes from the start, and so
// a reader looking for a format finds where it will live rather than
// wondering whether it exists.