Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

i cant get any output #4

Open
Gnosnay opened this issue Jun 2, 2019 · 0 comments
Open

i cant get any output #4

Gnosnay opened this issue Jun 2, 2019 · 0 comments

Comments

@Gnosnay
Copy link

Gnosnay commented Jun 2, 2019

this is my code in typescript

var levelup = require('levelup');
var leveldown = require('leveldown');
var inverted = require('inverted-index');

let db = levelup(leveldown('./.mydb'));

var level = require('level')('./.mydb');
var sublevel = require('sublevel');
var index = inverted(sublevel(db, 'index'), {
	rank: true,
	rank_algorithm: 'cosine',
	facets: true
}, function (id: any, options: any, fn: any) {
	level.get(id, options, fn);
});

index.index('john green', 1, function (err: any) {
	console.log(err)
});

try {
	index.query('green', function (err: any, result: any) {
		console.log(err)
		console.log(result)
	})
} catch (error) {
	console.log(error)
}

while (1) {

}

i dont know why it happend...
would u mind giving some suggestion?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant