X hits on this document

513 views

0 shares

1 downloads

0 comments

114 / 142

Apache

  • 1.

    updating a globally defined HTML scalar

  • 2.

    opening the index ($INDEX) previously defined

  • 3.

    creating a swish-e search object

  • 4.

    setting the sort order

  • 5.

    reading the query from the query string and searches

  • 6.

    getting the number of returned hits

  • 7.

    initializing a hit list

  • 8.

    looping through each hit pulling out the desired properties for display

  • 9.

    closing the hits list

The trickiest part of the routine is the definition of $detail. This variable holds the path to the found item (swishdocpath). By creating a hot link using this variable the user of the index is able to view the full re- cord.

To see how this works in real life:

  • 1.

    Install Apache.

  • 2.

    Edit Apache's httpd.conf file.

  • 3.

    Start Apache.

  • 4.

    Copy the xml-data/xhtml/marc2xhtml directory to Apache's htdocs directory.

  • 5.

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

  • 6.

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

  • 7.

    Edit xhtml.cfg so IndexDir points to marc2xhtml (IndexDir marc2xhtml).

  • 8.

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

  • 9.

    Index marc2xhtml ( swish-e -c xhtml.cfg ).

  • 10.

    Edit xhtml.cgi's first line so it points to Perl (Unix: #!/usr/bin/perl or Windows: #!c:\perl\bin\perl).

  • 11.

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

XHTML.

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

(If you have gotten this far, the breath a sigh of relief. That was the most complicated exercise, and it is all downhill from here.)

Improving display of search results

The search results of the XHTML index were rudimentary. In this exercise you will see how the swish-e properties (and therefore XML elements) can be displayed in greater detail. Mods.cgi implements this

106

Document info
Document views513
Page views519
Page last viewedTue Jan 17 22:13:36 UTC 2017
Pages142
Paragraphs3126
Words34660

Comments