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

NAME

NexTrieve::Search - handle searching with NexTrieve

SYNOPSIS

 use NexTrieve;
 die unless NexTrieve::Search->executable;

 $ntv = NexTrieve->new( | {method => value} );

 # using collections
 $collection = $ntv->Collection( path );
 $search = $collection->Search( mnemonic, | indexname );

 # using direct access
 $resource = $ntv->Resource( | file | xml | {method => value} );
 $search = $ntv->Search( | file | $resource | host:port | port );

 $query = $ntv->Query( file | xml | {method => value} );

 # using Perl DOM
 $hitlist = $search->Hitlist( file | xml | $query );
 foreach ($hitlist->Hits) {

 # using external file (e.g. for XSLT transformations)
 $search->Hitlist( file | xml | $query, $filename );
 system( "xsltproc stylesheet.xsl $filename" );

DESCRIPTION

The Search object of the Perl support for NexTrieve. Do not create directly, but through the Search method of the NexTrieve or the NexTrieve::Collection object.

The NexTrieve::Search object either accesses a NexTrieve search service through the "ntvsearch" program (as described on http://www.nextrieve.com/usermanual/2.0.0/ntvsearch.stm ) or through a NexTrieve server process using the "ntvsearchd" program (as described on http://www.nextrieve.com/usermanual/2.0.0/ntvsearchd.stm ), previously started by a NexTrieve::Daemon object.

CLASS METHODS

These methods are available as class methods.

executable

 $executable = NexTrieve::Daemon->executable;
 ($program,$expiration,$software,$database) = NexTrieve::Search->executable;

Return information about the associated NexTrieve program "ntvsearch". Please note that calling this method only makes sense if the search service is not running as a server process.

The first output parameter contains the full program name of the NexTrieve executable "ntvsearch". It contains the empty string if the "ntvsearch" executable could not be found or is not executable by the effective user. Can be used as a flag. Is the only parameter returned in a scalar context.

If this method is called in a list context, an attempt is made to execute the NexTrieve program "ntvsearch" to obtain additional information. Then the following output parameters are returned.

The second output parameter returns the expiration date of the license that NexTrieve is using by default. If available, then the date is returned as a datestamp (YYYYMMDD).

The third output parameter returns the version of the NexTrieve software that is being used. It is a string in the form "M.m.rr", whereby "M" is the major release number, "m" is the minor release number and "rr" is the build number.

The fourth output parameter returns the version of the internal database that will be created by the version of the NexTrieve software that is being used. It is a string in the form "M.m.rr", whereby "M" is the major release number, "m" is the minor release number and "rr" is the build number.

OBJECT METHODS

These methods are available to the NexTrieve::Search object.

Hitlist

 $hitlist = $search->Hitlist( $xml | $query );
 $search->Hitlist( $xml | $query, filename );

The "Hitlist" method returns a NexTrieve::Hitlist object for a query or stores the hitlist XML in the file specified.

The first input parameter specifies the query XML that should be sent to the search service. It can either be the "real" query XML that you created yourself, or a NexTrieve::Query object.

The second input parameter is especially important if the "Hitlist" method is called in a void context: it specifies the filename in which the hitlist XML should be directly stored.

If the "Hitlist" method is called in a void context, the actual parsing of the hitlist XML is skipped, making for a very much faster method. This way of calling the "Hitlist" method is especially handy when processing hitlist XML using other means, e.g. the "xsltproc" program of the "libxml2" package (as available from http://gnome.org ).

Resource

 $resource = $search->Resource;
 $search->Resource( $resource | file | xml | {method => value} );

The "Resource" method is primarily intended to allow you to obtain the NexTrieve::Resource object that is (indirectly) created when the NexTrieve::Search object is created. If necessary, it can also be used to create a new NexTrieve::Resource object associated with the NexTrieve::Search object.

OTHER METHODS

The following methods address other properties of the NexTrieve::Search object.

indexdir

 $search->indexdir( $indexdir );
 $indexdir = $search->indexdir;

The "indexdir" method specifies an indexdirectory other than the indexdirectory that is specified in the Resource object. By default, the indexdirectory information from the Resource object is used.

AUTHOR

Elizabeth Mattijsen, <liz@dijkmat.nl>.

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

SUPPORT

NexTrieve is no longer being supported.

COPYRIGHT

Copyright (c) 1995-2003 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.