How to show examples of keyword matches in the search result listings
This search engine can be made to show an example of the search keyword being used in the document text.
By default, the search results include only title, URL, and description. Consider this example of a default listing:
The "show examples" feature extends the listing by including an example of how the search keyword is used in the document text. The keyword is shown in bold:
The advantages of using the show examples feature are:
Visitors can better evaluate whether a document will be relevant to their search.
In our example, if the visitor had been interested in sniffing glue but not sniffing packets, he would have immediately known not to choose this result, without having to follow the link and scan through the entire document.
Provides descriptive information for documents whose given title and description are not helpful (as, for example, on sites where all descriptions are the same for all documents).
A disadvantage of this feature is that the search engine will require slightly more memory, disk space, and processor time.
How to Enable this Feature
Go to "Admin Page" => "User Interface"
Edit the setting "Show Examples: Enable" and set it to one (checked).
You may want to edit the "Show Examples: Number to Display" variable. Leaving it at its default value of one will incur only a very light memory and processor time hit. Setting it to any value larger than one will incur a larger hit.
You may want to stop stripping common words from the index files, since common words make the examples more readable. To stop stripping common words, go to "Admin Page" => "General Settings" and edit the "Ignore Words" setting. Delete all of the words listed there. Then rebuild all index files. Retaining common words will cause FDSE to use a little more memory, disk space, and processor time, but the search results excerpts will be much more readable.
The search keyword will be shown in bold using the "hl2" CSS class. You can customize that CSS class in the style.inc file to highlight it in other ways, such as with italics or different colors.
Note: if all of the META descriptions on a web site are identical or otherwise not helpful, they can be removed entirely from the search results listing by editing the "line_listing.txt" template which also appears on the "Admin Page" => "User Interface" screen. The description will be removed from the results if you delete the
%description% replacement variable from that template.
See also Controlling excerpt length.
"How to show examples of keyword matches in the search result listings" http://www.xav.com/scripts/search/help/1121.html