12 lines
309 B
JavaScript
12 lines
309 B
JavaScript
require('bare-process/global')
|
|
const { HyperP2PInvertedIndex } = require('../index.js')
|
|
|
|
async function main () {
|
|
const m = new HyperP2PInvertedIndex()
|
|
m.index('doc-1', ['pear', 'runtime'])
|
|
console.log('[inverted-index]', m.search('pear'), m.getStats())
|
|
await m.close()
|
|
}
|
|
|
|
main().catch(console.error)
|