The output I am receiving is:
[{"ref":"contact.html","score":0.7071067811865475}]
$.getJSON( "index.json", function(data) {
idx = lunr.Index.load(data);
var searchResults = idx.search(variabletosearch);
var formattedResults = JSON.stringify(searchResults);
console.log(formattedResults);
});
How can I extract the value of 'ref'? When I attempt
console.log(formattedResults[0].ref);
it returns undefined.