feat(modules): deepen trust, experimental, routing, and search
Hyper-P2P Module Tests / unit-all (push) Failing after 1h17m5s
Hyper-P2P Module Tests / unit-all (push) Failing after 1h17m5s
Session revoke and encrypted-topic JSON helpers; silence/void channel snapshots; relay tunnel route listing; grow-only set algebra; CPU top donors; attestation chain slice/export; fulltext bulk and top terms. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -114,6 +114,29 @@ class HyperP2PFulltextLite extends EventEmitter {
|
||||
return [...this._docs.values()]
|
||||
}
|
||||
|
||||
bulkAdd (entries) {
|
||||
if (!Array.isArray(entries)) throw new Error('entries array required')
|
||||
let n = 0
|
||||
for (const e of entries) {
|
||||
if (e && e.id != null) {
|
||||
this.addDocument(e.id, e.text || '')
|
||||
n++
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
termCount () {
|
||||
return this._index.size
|
||||
}
|
||||
|
||||
topTerms (limit = 10) {
|
||||
return [...this._index.entries()]
|
||||
.map(([term, set]) => ({ term, docs: set.size }))
|
||||
.sort((a, b) => b.docs - a.docs)
|
||||
.slice(0, limit)
|
||||
}
|
||||
|
||||
getStats () {
|
||||
return {
|
||||
...this._stats,
|
||||
|
||||
Reference in New Issue
Block a user