Version 1.3 of SWISH-E now allows you to specify certain META tags that can be used as document properties. The contents of any META tag that has been identified as a document property will be returned as part of the search results along with the rank, file name, title, and document size.
This example defines three document properties:
PropertyNames description author datamodified
This is a META tag example that sets the value of the "author" property to "Jefferson" and the "description" as shown:
<meta name="author" content="Jefferson">
<meta name="description" content="Blueprints">
<meta name="datamodified" content="Jul-4-1776">
This example will return two document properties:
swish-e -w Independence -p description author
# DocProperty 1: description
# DocProperty 2: author
This example of search results uses the previously shown META tags:
1000 http://www.usa.gov/constitution.html "Title" 10232 "Blueprints" "Jefferson"
IncreaseInSize (bytes) = (2 * <NumberOfFiles>) + (5 * <NumberOfPropertyMetaTagsInAllFiles>) + (<LengthOfAllPropertyValuesInAllFiles>)
Accessing the document properties from the SwishTest.pl cgi example program is relatively easy. Here are the changes that need to be made to support the running example:
open(SWISH, "$swish -w $query -m $results -f $index|");
open(SWISH, "$swish -w $query -m $results -f $index -p description author |");
($stringone, $title, $filesize) = split(/\"/, $_);
($stringone, $title, $filesize, $description, $junk, $author) = split(/\"/, $_);
print "<LI><A HREF=\"$url\">$title</A><BR>";
print "<LI><A HREF=\"$url\">$title</A> - $description (<I>$author</I>)<BR>";
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Hewlett-Packard Company
Originally by Kevin Hughes, kev@kevcom.com, March 11, 1994.
SWISH-E is distributed with no warranty under the terms of the GNU Public License,
Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Public questions may be posted to
the SWISH-E Discussion.
Document maintained at http://sunsite.berkeley.edu/SWISH-E/Manual/UsageOverview.html
by the SunSITE Manager.
Last update December 16, 1998. SunSITE Manager:
manager@sunsite.berkeley.edu