RunKit + npm: elasticlunr

node v8.17.0
version: master
endpointsharetweet
var elasticlunr = require("elasticlunr") var index = elasticlunr(function () { this.addField('title'); this.addField('body'); this.addField('section'); this.setRef('id'); }); index.addDoc({ id: 1, title: 'Title', body: 'body body', section: 'whatever' }); index.addDoc({ id: 2, title: 'Another TItle', body: 'face face', section: 'another' }); console.log(index.search('title', { fields: { title: {boost: 2}, body: {boost: 1} }, bool: 'OR', expand: true }));
Created from: https://npm.runkit.com/elasticlunr
Loading…

no comments

    sign in to comment