Skip to content

Commit 26aa788

Browse files
committed
Document the two senses of "index"
The audit flagged NearestNeighborSearchIndex as misnamed on the grounds that it holds List<Index> and List<Cache>, so it is the engine rather than an index. That reasoning missed that the word covers two levels and both are right in their place: the library as a whole is an index, which is the sense Uber Similarity Search Index carries, while an Index is one searchable structure inside it. So the facade keeps its name, and the actual confusion - one word, two levels - is stated where it belongs rather than fixed by a rename that would leave a library called an index with nothing named one at the top.
1 parent 794a25c commit 26aa788

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

DESIGN.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,23 @@ Enums a config names implement `ConfigVocabulary`, which holds the one
127127
case-insensitive lookup and the one unsupported-value message. A config never
128128
names a record type, so `RecordType` is not among them.
129129

130+
## Two Senses Of "Index"
131+
132+
The word covers two levels, and both are correct in their place.
133+
134+
The library is an index: `NearestNeighborSearchIndex` is the whole searchable
135+
thing, which is the sense the project's own name carries in Uber Similarity
136+
Search Index. It stores rows, answers queries, and is the only type an
137+
embedder needs.
138+
139+
An `Index` is one searchable structure inside it, a sibling of a `Cache` and
140+
a `SearchableStructure` like it. The facade owns a list of these and a list
141+
of caches, and merges their results.
142+
143+
So the facade holding indexes rather than being one is not a contradiction.
144+
A reader who expects `NearestNeighborSearchIndex` to extend `Index` has the
145+
narrow sense in mind; nothing does, and nothing should.
146+
130147
## Package Layout
131148

132149
### Searchable Structures

0 commit comments

Comments
 (0)