Highlight words and phrases within specified elements on the page. Search syntax is trimmed or eradicated, stopwords and words less than 3 characters are ignored.
You will need:
Pass an array of terms to be highlighted in jquery-selected elements:
Parse raw search input to strip out stopwords, query syntax characters, and wee short words less than 3 characters that do nobody any good. Quoted phrases are treated as a single term.
Put it all together to retrieve raw search input from the query string, parse out terms to highlight, and highlight within specified containers.
- Use of <b> tags with inline style as highlight wrappers: Google cache pages.
- List of English stopwords: http://www.ranks.nl/resources/stopwords.html.
- First use: ARC-BC (Accessible Resource Centre British Columbia), http://www.arc-bc.org.