Keyword search

node v8.17.0
version: master
var qm = require('qminer'); // create the base object with the desired schema var base = new qm.Base({ mode: 'createClean', schema: [{ name: 'tweets', fields: [{ name: 'text', type: 'string' }], keys: [{ "field": "text", "type": "text_position" }] }] });
// push the data let tweetStore ='tweets'); tweetStore.push({text: "This pen is green."}); tweetStore.push({text: "This pen is yellow."}); tweetStore.push({text: "This pen is blue."}); tweetStore.push({text: "This marker is yellow."});
let query = { $from: "tweets", $or: [{text: "pen"}, {text: "yellow"}] }; var res =;
res.toJSON().records.forEach((obj) => { console.log(obj.text); })

no comments

    sign in to comment