Closed beshur closed 9 years ago
Went along with the option 1.
Something like this:
// el - is a main string to search
var add = {
id: Date.now() + Math.ceil(Math.random()*1000),
body: el
};
// split the json piece (which is msg: {})
var json = (/msg: ({.*})/).exec(el);
if (json.length > 1) {
// replacing quotes (") to enable search
add.json = json[1].replace(/"/g, " ");
}
this.logIndex.add(add);
Hi.
I am making a web log viewer using lunr.js and I have the string like this:
At the moment, when I just add them to index as a string, the search does not return anything that is inside JSON
{}
. What is a good way to search it too? I see two options here:Any comments on this?