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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//! [`Slot`] — WHICH CORPUS a declaration's elected field is written to, as a type.
use crateSlotName;
/// ONE SLOT of a declaration: an elected field, and the engine that holds it.
///
/// A derived index's expansion emits one zero-sized type per `(elected field × declared engine)` and
/// implements this on it. Nothing implements it by hand, and the trait is public because a
/// deployment NAMES one: opening a handle is `SlotHandle<E, ThatSlot>`, so the marker has to be
/// spellable wherever the handle is opened.
///
/// # Why slot identity is the PAIR, and what moved to get here
///
/// It used to be the declaration — one name per index, and *one declaration, one slot* was the law
/// the brand rested on. The engine grammar re-keys it, because a declaration may now name several
/// engines and a deployment may run more than one of them at once. Both halves are load-bearing:
///
/// - the FIELD, because the per-slot laws are per-corpus. ONE Tantivy index per slot is BM25's
/// own arithmetic — `docfreq` over `numdocs`, and the length normalization's average — and those
/// statistics are index-wide, so two fields sharing one index move each other's scores. Splitting
/// by field is what lets a title and a body be searched independently.
/// - the ENGINE, because two engines holding one field are two corpora with nothing in common. A
/// name shared between them would have one engine's write land in the other's store, which is the
/// wrong-write class the brand exists for.
///
/// The COLUMN axis is one grain FINER and is untouched: a vector slot may hold several columns, and
/// [`VectorColumn`](super::VectorColumn) still says which one a knn runs over. This is the axis
/// above it, not a replacement for the one below.
///
/// # It NAMES the pairing; it does not open it
///
/// Every constant here is a fact of the DECLARATION, so they exist in every build — including a
/// build that compiled no engine at all. What such a build does not have is the engine to open the
/// slot ON, which is the seam's own refusal and not this one's.
/// ONE ROW OF THE MEMBER TABLE: an engine WORD a graph root bound, and the type it named.
///
/// A root's `engines(hnsw = "app::hnsw::Hnsw")` emits one zero-sized type per entry and implements
/// this on it. Nothing implements it by hand.
///
/// # What the table is FOR
///
/// A field names its engines by WORD, because a declaration is written before any deployment exists
/// and a path written there would bind the engine in a library that cannot know which one an
/// application compiled. The root is where the program is assembled, so the root is where a word
/// becomes a type — and this trait is the join, at COMPILE time rather than through a runtime map,
/// because a member resolved by name at run time is a member no signature can be written against.
///
/// # A SHIPPED word is not bound here
///
/// `tantivy` self-binds under `feature = "tantivy"`, exactly as `postgres` does one family over: the
/// framework knows the type, so the deployment says only whether it compiled it. Binding a shipped
/// word at a root is refused by name — one word with two meanings in one program is the collision
/// this table exists to make impossible.