fuzzy
fuzzy copied to clipboard
Highlighting results
I was just wondering how I would go about hilighting my search results like done so on the Disney Demo I can't see to figure it out.
Just thinking out loud here.....
I actually am trying to use this with a JSON file fill of objects that look like this {"action": "this-action, "keyword": "I am a keyword"} And i noticed that options would only take one of the elements I had there so I used this work around like this
var options = {
pre: "<b>",
post: "</b>",
extract: function(el) {
return el.action + "" + el.keyword;
}
to see if it would check both/one or the other action and/or keyword and the results show up as so, but I noticed that string is equivalent to action + keyword which might not be ideal when trying to highlight the characters matching the search. I am only saying this because I am thinking that I would replace (for the filtered out search results) action or keyword with string but I would get an unwanted mixture of both of those values.