查询返回对象增加took(us)和ioCount

This commit is contained in:
Wu Jian Ping
2022-07-21 22:31:44 +08:00
parent 743bbd204b
commit 4fde2363fa
4 changed files with 46 additions and 10 deletions

View File

@@ -14,16 +14,19 @@ const searcher3 = Searcher.newWithFileOnly(dbPath)
describe('ip2region', () => {
it('#newWithFileOnly and search', async () => {
const d = await searcher3.search('218.4.167.70')
expect(d).equal('中国|0|江苏省|苏州市|电信')
console.log(d)
expect(d.region).equal('中国|0|江苏省|苏州市|电信')
})
it('#newWithVectorIndex and search', async () => {
const d = await searcher2.search('218.4.167.70')
expect(d).equal('中国|0|江苏省|苏州市|电信')
console.log(d)
expect(d.region).equal('中国|0|江苏省|苏州市|电信')
})
it('#newWithBuffer and search', async () => {
const d = await searcher1.search('218.4.167.70')
expect(d).equal('中国|0|江苏省|苏州市|电信')
expect(d.region).equal('中国|0|江苏省|苏州市|电信')
})
})