Connection problem between problemlunr.ja.js tinyseg
Opened this issue · 1 comments
aveclumiere commented
Hi, Thank you for this awesome project!
I'm using lunr with Japanese text, so I write code like this
var lunr = require('lunr');
require('./language/lunr.stemmer.support.js')(lunr);
require('./language/lunr.jp.js')(lunr);
var idx = lunr(function() {
this.use('lunr.jp');
this.addField('title');
this.addField('body');
this.setRef('id');
})
But when I execute script, error occur with message
"TypeError: lunr.TinySegmenter is not a function"
I think there are some connection problems between lunr.jp.js and tinyseg.js.
I'm not familliar with JS, so I don't know how to fix this problem.
Can someone helps me?
myalgo commented
This should help
var lunr = require('lunr');
require('lunr-languages/lunr.stemmer.support')(lunr);
require("lunr-languages/tinyseg")(lunr);
require('lunr-languages/lunr.jp')(lunr);
var idx = lunr(function() {
this.use('lunr.jp');
this.addField('title');
this.addField('body');
this.setRef('id');
})