X hits on this document

418 views

0 shares

1 downloads

0 comments

115 / 142

Apache

idea. It is just like the previous example except for part of the while loop in the search subroutine:

  • #

    process each hit

while (my $result = $results->NextResult)

{

  • #

    get the results

my $detail my $title my $author my $extent my $note my $topic

= $result->Property = $result->Property = $result->Property = $result->Property = $result->Property = $result->Property

('swishdocpath'); ('title'); ('namePart'); ('extent'); ('note'); ('topic');

my $publisher = $result->Property ('publisher');

my $date

= $result->Property ('dateIssued');

$hit list .

_

= "<li>$title (<a href='$detail'>full record</a>) <ul> <li><small><b>author</b>: $author</small></li> <li><small><b>extent</b>: $extent</small></li> <li><small><b>note</b>: $note</small></li> <li><small><b>topic</b>: $topic</small></li> <li><small><b>publisher</b>: $publisher</small></li> <li><small><b>date</b>: $date</small></li> </ul> <br /> </li>";

}

As you can see, many of the index's properties are read from each result. These properties are then marked up in a number of unordered lists. Like before, the swishdocpath property is hyperlinked to provide access to the original document.

Give this script a whirl by:

  • 1.

    Copying the xml-data/mods/many directory to Apache's htdocs directory.

  • 2.

    Copy cgi-bin/mods.cgi to the htdocs directory.

  • 3.

    Copy swish-indexes/mods.cfg to the htdocs directory.

  • 4.

    Edit mods.cfg so IndexDir points to many (IndexDir many).

  • 5.

    Edit mods.cfg so IndexFile outputs to mods.idx (IndexFile mods.idx).

  • 6.

    Index the contents of many ( swish-e -c mods.cfg ).

  • 7.

    Edit mods.cgi's first line so it points to Perl.

  • 8.

    Open a command prompt and run mods.cgi from the command line. It should return a stream of

XHTML.

9.

Finally, open your Web browser and point it to mods.cgi.

107

Document info
Document views418
Page views424
Page last viewedTue Dec 06 16:59:09 UTC 2016
Pages142
Paragraphs3126
Words34660

Comments