The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

NexTrieve::Hitlist - handle the Hitlist specifications of NexTrieve

SYNOPSIS

 use NexTrieve;
 $ntv = NexTrieve->new( | {method => value} );
 $search = $ntv->Search( file | $resource | server:port | port );
 $query = $ntv->Query( | file | xml | {method => value} );
 $hitlist = $search->Hitlist( $query | xml | {method => value} );

DESCRIPTION

The Hitlist object of the Perl support for NexTrieve. Do not create directly, but through the Hitlist method of the NexTrieve object.

Please note that you rarely create the NexTrieve::Hitlist object directly. It is usually created by the NexTrieve::Search object or the NexTrieve::Replay object.

OBJECT METHODS

The following methods return one or more objects.

Hit

 foreach $ordinal ($firsthit..$lasthit) {
   $hit = $hitlist->Hit( $ordinal );
 # display result here
 }

The "Hit" method returns a NexTrieve::Hitlist::Hit object. The input parameter indicates the ordinal number of the hit for which to return the Hit object. The range of the ordinal number is determined by what the methods firsthit and lasthit return.

See method Hits to have list returned with all NexTrieve::Hitlist::Hit objects that are contained in the object.

Hits

 foreach $hit ($hitlist->Hits) {
 # display result here
 }

The "Hits" method returns the list of NexTrieve::Hitlist::Hit objects that is contained in the object. Use method ordinal on the NexTrieve::Hitlist::Hit object to find out its ordinal number (what you would have otherwise specified as the input parameter to the Hit method.

OTHER METHODS

The following methods return aspects of the NexTrieve::Hitlist object.

id

 $id = $hitlist->id;

The "id" method returns the value of the "id" field in the hitlist. It is only returned if the "id" method was called on the NexTrieve::Query object that was used to create this hitlist.

firsthit

 $firsthit = $hitlist->firsthit;

The "firsthit" method returns the ordinal number of the first hit in the hitlist. This is always the same as the value that was specified with the "firsthit" method on the NexTrieve::Query object.

See lasthit to find out the ordinal number of the last hit.

lasthit

 $lasthit = $hitlist->lasthit;
 

The "lasthit" method returns the ordinal number of the last hit in the hitlist. This is always the same or less than the value that was specified with the lasthit method on the NexTrieve::Query object.

See firsthit to find out the ordinal number of the first hit.

displayedhits

 $displayedhits = $hitlist->displayedhits;

The "displayedhits" method returns the number of hits that are returned in the hitlist. If the firsthit was specified to be one, or omitted in the creation of the NexTriev::Query object, then this has the same value as returned by method lasthit.

totalhits

 $totalhits = $hitlist->totalhits;

The "totalhits" method returns the number of hits that could have been returned maximally in the hitlist. It is always the same or less than the value that was specified with the "totalhits" method of the NexTrieve::Query object.

admin

 $admin = $hitlist->admin;

The "admin" method returns the administrative information that was returned with the hitlist. This is only returned if there was administrative information specified in the NexTrieve::Resource object that was used to index the content and if any errors or warnings are returned.

errors

 @error = $hitlist->errors;

The "errors" method returns a list of errors that were returned in the hitlist. If an error occurs, it is usually wise to perform some action that notifies the administrator of the search engine, as it indicates a serious problem in the functioning of the search engine.

warnings

 @warning = $hitlist->warnings;

The "warnings" method returns a list of warnings that were returned in the hitlist. You may choose to display these to the user of the search engine. Warnings include e.g. "Word xxxx not found in dictionary" if exact searching was used and that particular word does not occur in any document. If this happens when a single word was entered, it may be wise to point out to the user that a fuzzy search is also possible, or maybe even automatically perform the same search now with the fuzzy mode set.

AUTHOR

Elizabeth Mattijsen, <liz@dijkmat.nl>.

Please report bugs to <perlbugs@dijkmat.nl>.

SUPPORT

NexTrieve is no longer being supported.

COPYRIGHT

Copyright (c) 1995-2002 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

The NexTrieve.pm and the other NexTrieve::xxx modules.