I am testing out the plugin “searchHighlight” to highlight search terms on our Search page when one searches for a keywords. The problem is that it only reads the referral URL and I do not know how to modify this so it only reads the current URL that your on instead of the referral.
I.e.
- I use our search box from my home page
- I search for ‘glass door’
- Results come up on the search page but no highlighting
- I click a product with the words ‘glass’ or ‘door’ in it
- On the product page it highlights the words I searched for (‘glass’ + ‘door’)
Example URL Searched: http://tsqja.deznp.servertrust.com/SearchResults.asp?Search=glass+door&x=0&y=0
From the example I tried to give above you can see it is highlighting based off the Referral URL Keywords. I want it to use the actual search results. Given regex this is my search results page:
[/^http:\/\/(tsqja\.)?deznp\.servertrust/i,/Search=([^&]+)/i]
Anyone know how this can be achieved? Get highlighted search terms based off the above regex via jQuery preferably?
You can use the
keysconfiguration option to set the highlighting up manually on the search page. You could use a small script to get the search term from the url using a regex, then pass the configuration into SearchHighlight:Using the
keysoption completely disables the referrer checking.