Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting results #46

Open
dorkycam opened this issue Aug 9, 2018 · 1 comment
Open

Highlighting results #46

dorkycam opened this issue Aug 9, 2018 · 1 comment

Comments

@dorkycam
Copy link

dorkycam commented Aug 9, 2018

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.

@dorkycam
Copy link
Author

dorkycam commented Aug 9, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant