inverted icon indicating copy to clipboard operation
inverted copied to clipboard

i cant get any output

Open Gnosnay opened this issue 5 years ago • 0 comments

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?

Gnosnay avatar Jun 02 '19 12:06 Gnosnay