Updates
This commit is contained in:
@@ -1,15 +1,25 @@
|
||||
# hyper-p2p-inverted-index architecture
|
||||
# Architecture: hyper-p2p-inverted-index
|
||||
|
||||
**Tier:** scaffold · **Category:** `indexes-search`
|
||||
**Category:** indexes-search
|
||||
|
||||
## Role
|
||||
```mermaid
|
||||
flowchart LR
|
||||
App[Application] --> Mod[HyperP2PInvertedIndex]
|
||||
Mod --> Mux[Protomux inverted-index/v1]
|
||||
Mux --> Swarm[Hyperswarm]
|
||||
```
|
||||
|
||||
Inverted index (local + gossip).
|
||||
## Wire messages
|
||||
|
||||
| type | fields | behavior |
|
||||
|------|--------|----------|
|
||||
| `term-index-sync` | `op`, `term`, `docId`, `peer`, `at` | Merge add/remove postings |
|
||||
|
||||
## State model
|
||||
|
||||
- `_terms`: `Map<term, Set<docId>>`
|
||||
- `_docs`: `Map<docId, Set<term>>` for efficient removal
|
||||
|
||||
## Composition
|
||||
|
||||
Uses `../../_shared/p2p-bare.js` for Hyperswarm + Protomux when implemented. Does **not** duplicate Holepunch core storage/transport.
|
||||
|
||||
## Holepunch boundary
|
||||
|
||||
Inspiration: n/a
|
||||
Uses `../../_shared/p2p-bare.js` (`initModuleSwarm`, `gossipSend`).
|
||||
|
||||
Reference in New Issue
Block a user