Help with PicoSearch

Can PicoSearch do Hit Highlighting?

Yes. PicoSearch offers two kinds of Hit Highlighting in the search results for paid accounts. Free accounts can also test the feature from the account manager's "Hit Highlighting & Navigation" section.


Introduction to Hit Highlighting

What is hit highlighting? Seen in some web search engines, hit highlighting is the option to go to a modified version of a web page from the list of search results, and see the words you are interested in highlighted with bright colors. This definitely helps users to find what they're looking for more quickly, and it's even kind of fun. Drawbacks traditionally include that the user may see an older version of a page, hits still have to be scrolled to manually in long pages, and the colors can be distracting with no way to turn them off. Sometimes the display isn't even right.

PicoSearch has now re-invented hit highlighting in a major new way, just for the needs of webmasters and focused site search. Limitations of highlighting have been addressed with never-before-seen functionality that is fast, accurate, and exciting for users. If this catches on across the internet, remember you saw it here first!

  • Up-to-date results for HTML and text

    Hits are calculated live from your site, not from previous (cached) data that risks showing users old information. This is the most desirable solution for webmasters, and the process has been optimized for maximum speed so users won't notice a difference. Future releases will include more formats like PDF.

  • Traditional or Frame Navigation

    If you like the usual hit highlighting approach that forces users to scroll down a single page, the Traditional option is available. At least in PicoSearch, clicking on a hit from the top will jump to the first word occurrence. But things get really interesting in Frame Navigation. An easy-to-use navigation bar shows total occurrences with arrows to automatically scroll the user to the next hit that interests them most. Users love it, and webmasters can know that the best information is being found fast.

  • Full accurate integration with your custom search

    PicoSearch offers great accuracy and flexibility in search, and so does the highlighter. When a user types a word, they can find not only the exact word but also the singular and plural forms, upper or lowercase, possessives, accented or unaccented, British and American spelling variants, spelling corrections, phrases, and even your own user synonyms. All of the hits can be highlighted and found, and in just the places you want them found. If you're searching drop-down menu items or skipping parts of navigation, the highlighter will know. If you want to include or exclude certain files for highlighting, you can set that precisely.

  • Customizability of appearance and messages

    Don't like the standard highlighting colors? Set your own, including white fonts on dark colors. Need to localize the translation or give messages tailored to your website? No problem, PicoSearch gives hooks to set your own text for the various highlighting conditions. Also decide where the link to highlight appears in your search results, and what it will be called.

  • Users turn highlighting on/off at their convenience

    In Traditional hit highlighting, you're kind of stuck. If the colors annoy you or you're trying to print, you have to open a new window and find your place without the hits. But in PicoSearch's Frame Navigation Highlighting, there's even an on/off switch for the highlights that won't lose your place. The current highlight is still highlit when scrolling (the highlight highlight!)

Try it and see! Let's search for "PicoSearch hits" on this very FAQ that you're reading. Of course, there will be an unusually large number of hits, so it's a good test for that highlight off switch too. Click here to try Traditional or Frame Navigation



Hit Highlighting for Webmasters

Okay, let's get into the details of the hit highlighter's functionality.

To start, see the "Hit Highlighting & Navigation" section of your account manager, under the "Designing" features. Here you choose all the essential settings, including which type of highlighter to use, the placement of the link in the search results, the name of the link, and the sequence of colors to be used in highlighting. Clearing any input boxes will restore defaults.


Frames and Link Targeting: Both the Traditional and Frame hit highlighters work by serving a version of your site's page from the PicoSearch domain, so that highlights can be inserted for the search hits. This poses just a few challenges to make sure that your page and its links behave properly. We try to think of everything for you, and your site will probably work just fine, but here are the issues.

If you have relative links on your site, that is links that don't start with http:// in the URL, then the browser depends on the site they're coming from to fill in the full address. When the highlighting is coming from www.picosearch.com, the HTML tag <base> is inserted with href equal to the URL of your page. This tells the browser that any relative URLs should be filled in from your site and not PicoSearch. This should work well for most everyone. But if you already play with the base tag, or if you have some kind of unusual applet linking that doesn't get the base, just make sure that your links are all fully qualified (starts with http:// in the URL).

If you choose the Frame highlighting, make sure your site doesn't mind being in a frame. For example, you might have frame-busting javascript code so that other websites can't present your pages as their own. The solution is easy: you can surround your frame-buster, and anything else that shouldn't run in the frame highlighter, with <!-- PICOSEARCH_HIGHLIGHT_CUTSTART --> and <!-- PICOSEARCH_HIGHLIGHT_CUTEND --> This will simply remove that section from the version of your page that will go in the highlighter frame.

Speaking of frame busting, what happens when the user clicks on your page's links inside the highlighter frame? That's when we do want the frame busted, so if the user chooses to go on to the rest of your site from the hit highlighter then they won't be stuck in the highlighter frame. Again the HTML tag <base> comes to rescue, because it can take a target="_top" attribute value to target links out of the frame. But if for some strange reason this doesn't work for you, we have another solution here.


Special overrides: Here are some tags and args that can override the usual hit highlighter behavior.

<!-- PICOSEARCH_HIGHLIGHT_CUTSTART --> ...
<!-- PICOSEARCH_HIGHLIGHT_CUTEND -->
    Put in your page around anything that you don't want to display or run in the hit highlighter. It's good for removing frame-busting javascript that would defeat the Frame highlighter, for example.

<!-- PICOSEARCH_HIGHLIGHT_SKIPSTART --> ...
<!-- PICOSEARCH_HIGHLIGHT_SKIPEND -->
    Put in your page around anything that you do want to display or run in the hit highlighter, but you don't want any hits to highlight within. The implication here is that for some reason this is searchable text, but when it comes to highlighting you don't want the user's attention to go there. If you're using this tag to skip text such as navigation that probably shouldn't even be in the search results either, then you can rely on the PICOSEARCH_SKIPALL and PICOSEARCH_SKIPTEXT tags. They can make your search results more accurate (less noisy), and the highlighter will by default skip them too (unless mode_skip_skiptags=0 in the customizations, see below).

<input type="hidden" name="hits" value="1">
    Even if you have the hit highlighter turned off from your account manager, you can turn it on from specific search boxes with the run-time argument "hits". Put this in the scope of your PicoSearch search box code, and a value of 1 will make the Frame hit highlighter available in links of the search results for applicable documents. A value of 2 will make a Traditional highlighter. For controlling which documents get a highlighter link, see the Add/Exclude URLs feature described below.


Multiple Language Support: The search results page has translations in many languages available in your account manager's Results Language section. From these, you choose one to be your default display language, and then the runtime argument "lang" can invoke alternate languages for multi-lingual support from different search boxes. For details, see the language override FAQ.

Since hit highlighting is invoked from the search results page but it is also a separate feature, it has its own way of supporting multiple languages. The search results page will pass along your "lang" override, and the highlighter will use this to match the alternate language settings that you specify. The value can be anything as far as the highlighter is concerned, although the value has to be one of the selectable languages if you're depending on it to also match search results page translations.

Both the highlight hits link name which you enter in the account manager, and any customization fields described below, will take additional text preceded by <lang=(language)> For example, you could enter in the link name box:

highlight hits<lang=French>mis en surbrillance

Here, the search results page will use this French translation whenever lang=french. The first text will be used as the default if no language matches, whether or not it has a language tag of its own.


Customizations: In your account manager's "Hit Highlighting & Navigation" controls you can also turn on a kind of config file for the highlighter. Any changes you make from the default values will be stored and used. Clearing the box restores defaults. This is good for modifying or translating any of the text instructions of the highlighter, plus it accesses class styles and behavior modes:
arrow_left, arrow_right
set these to customize the nagivation arrows, including adding any surrounding styles (Frame highlighter only)
bgcolor_header
change the grey background color of the top header box
mesg_loading_frame, mesg_loading_header
change the two message points displayed while the Frame highlighter is loading
mesg_more
extra instructions can display at the navigation row (Frame only)
mesg_no_hit
If the browser says a hit is not visible, such as in a hidden layer, a box can pop up with this message in the hit word's color (Frame only). Browsers aren't always this helpful, so if you have a lot of hidden layer hits, you might consider the HIGHLIGHT_SKIPSTART tag described above to avoid users wondering where the hit went.
mesg_none
message displayed when, for some reason, no hits were visible at all for the user to see highlighted.
mesg_only
message displayed when hits are only found in one, two or three non-visible page positions which you may have made searchable from your account manager's Index Options. The location markers _LOC3, _LOC2 and _LOC1 are where the names of the positions will be plugged in. These markers are ordered 3, 2, 1 because if there are two positions the message will say _LOC2 and _LOC1, and so on. The location names come from mesg_only_menus, mesg_only_metas, and mesg_only_title.
mesg_only_menus
If you choose to search the text in your HTML menus (on by default in your account manager's Indexing Modes section) then this can present a problem for hit highlighting. Javascript menus can have highlighted hits, but HTML <select> options won't highlight. So any hit that is only found in menus will be listed in the format of mesg_only using the name from mesg_only_menus. You can make this blank to never say when a hit is only in menus.
mesg_only_metas
If you choose to search the meta descriptions or meta keywords of your HTML pages (off by default in your account manager's Indexing Modes section) then this can present a problem for hit highlighting since they won't be visible to the user. Any hit that is only found in meta data will be listed in the format of mesg_only using the name from mesg_only_metas. You can make this blank to never say when a hit is only in metas.
mesg_only_title
If you choose to search the titles of your HTML pages (on by default in your account manager's Indexing Modes section) then this can present a problem for hit highlighting since they won't be visible to the user. Any hit that is only found in the title will be listed in the format of mesg_only using the name from mesg_only_title. You can make this blank to never say when a hit is only in the title.
mesg_terms_frame, mesg_terms_trad
change the message in front of the hits, different for Frame or Traditional highlighting.
mesg_toggle_off, mesg_toggle_on
change the link text for turning hits on/off (Frame only)
mesg_toggle
change the description of the hits on/off link (Frame only). The marker _TOGGLE is where the text will be plugged in from mesg_toggle_off and mesg_toggle_on
mesg_url
change the description for the original URL. The marker _URL is where the actual page URL will be plugged in.
mode_frame_buster_installed
default 0, set to 1 if you need to install the additional frame buster solution here (Frames only of course)
mode_skip_skiptags
default 1, set to 0 if you have used the PICOSEARCH_SKIPALL and PICOSEARCH_SKIPTEXT tags in your pages to make some text not searchable, but for whatever reason when it comes to hit highlighting you want this text highlighted too. Default is 1 to skip only because the tags are usually for skipping noisy navigation that you don't want the user's attention drawn to anyway.
style_counts
list of CSS styles used on the hit totals seen between the arrows (Frame only)
style_hit, style_focus_hit, style_focus_only
lists of CSS styles used on the highlighted hits. Usually, a hit is bolded, a focussed hit (the current hit in the Frame navigation) is bolded and boxed, and a focus only hit (seen when highlighting is toggled off) is just boxed.
Lastly, note that the highlighting feature uses three new template codes for customizing the highlight link in the search results. These are PICO_CLASS_A_HIGHLIGHT and PICO_CLASS_SPAN_HIGHLIGHT (more..), and PICO_TEMPLATE_SEP_HIGHLIGHT (more..) Click the links for details in the template codes FAQ. In particular, if you don't like the bullet that appears next to the highlight hits link in the search results, that is set by the PICO_TEMPLATE_SEP_HIGHLIGHT.


A Word about Matches: As mentioned in the introduction above, PicoSearch will robustly match variations of the search word under the hit. This is the same as is done in the concordance (text excerpt) bolding seen in the search results, so it is generally desirable although it is certainly more highly visible. This includes matching upper and lower case (automatic), possessives (automatic), accented or unaccented (Alternate Character Options section), singular and plural forms (in the section for Synonyms, Spelling, Query Rules), British and American spelling variants (Set Synonyms & Spelling section), and even your own user synonyms (Set Synonyms & Spelling section). Most of these should make perfect sense to hit highlight for the user, but if you have particularly generous user synonyms (perhaps grouping a variety of product names) you might want to change the wording of the highlighter to say something like "Here are the suggested hits for your search". This can be done in the customizations by the mesg_terms or other settings.


Add or Exclude URLs: The link to highlight hits will be offered in your search results for every eligible document. The first release of hit highlighting works for HTML and text files, and later releases will highlight other formats such as PDFs. But what if you want to force the highlighter to add or exclude certain documents from highlighter linking? Just enter those URLs in the Add/Exclude box in your account manager's highlighting features. The wildcard * can be used to capture many URLs efficiently, and a minus sign - in front of the pattern will exclude. With this feature, you can control exactly which search results can get highlighted by the user.


Password Protection and Security Issues: If you have password protected areas (members only) on your website, PicoSearch needs to get in there too for hit highlighting those pages. So your account manager's highlighting section has the option to "Use Password Protection settings to access hits". If you entered htaccess or cookie settings in your Password Protection & Cookies feature for indexing, these settings can be used for highlighting too, just choose the option.

If you turn the option on, BE SURE THIS DOES NOT RESULT in unauthorized searchers seeing a protected page. If your search boxes are only inside your protected areas anyway, then you're safe to turn the option on. But if you keep the option off, or if you never used the Password Protection settings but rather relied on a special Entry Point to get PicoSearch into your protected pages, then the hit highlighting will never work on protected pages because PicoSearch's highlighter can't fetch them even when the user is authorized! See if you can use the htaccess and cookie settings to be consistent with hit highlighting.

If you must keep the option off but you want to use the highlighter, then you may need to help PicoSearch know which URLs to avoid for highlighting. From htaccess settings PicoSearch will know to avoid the htaccess directory for hit highlighting. Otherwise, if you keep the option off for cookie settings, or if you relied on a special Entry Point for protected area access, you should use the highlighter's Add/Exclude box to exclude the URLs that should never get hit highlighting. This will prevent users from getting a login page or other loading failure when they try to highlight a protected page.


We're sorry if that's complicated, please contact us if you need any assistance. We'll be happy to help!




Back to FAQs