Skip to main content.
home | support | download

Back to List Archive

Comments on new SWISH::API proposals

From: Alex Lyons <Alex.Lyons(at)>
Date: Tue Jan 14 2003 - 16:11:44 GMT
Dear swish-e list (Bill probably!),

We currently use swish-e 2.2.2 on our site via variants of the supplied swisg.cgi, but I'm thinking of writing something using the Perl module, so I'm looking with interest at the SWISH::API proposals in the current dev version.

Our site is split into about 9 main areas, so it seemed sensible to index each area separately and then give users the option of selecting which indexes to search in (all done nicely by swish.cgi).  In considering a move to a persistent Perl search engine, one of the main savings would, I presume, be that the indexes would remain open between queries.  But I'm not sure whether this will be possible using the proposed API.  The proposal, as I understand it, is:

$swish = SWISH::API->new('index1 index2 ...');
$search = $swish->New_Search_Object;
$results = $search->Execute($query);

If for each query the set of index files is likely to change, it looks like I'll have to go right back to reopening all the index files anew each time, which seems to negate some of the point of going for persistence.  Also, I can't see the point of distinguishing between the $swish and the $search  objects: one seems to be a superset of the other.

Ideally what I would like to see would be something like:

$index1 = SWISH::API->Open('index1');
$index2 = SWISH::API->Open('index2');
$search = SWISH::API->New_Search_Object($index1,$index2,...);
$results = $search->Execute($query);

In this case I'd only have to recreate the $search object for each query, which I'd have to do anyway if the user changed the sort order, or whatever.  The $index objects would be persistent, opened once at initialisation. Most of the methods you currently propose for the $swish object could become methods of the $search object.

Maybe the way multiple indexes are processed means there's nothing to be gained by pre-opening them individually?  But otherwise, could you please spare a thought for these comments? Unless I've completely missed some fundamental point...


Alex Lyons.

  This e-mail and any attachments may contain confidential and/or
  privileged material; it is for the intended addressee(s) only.
  If you are not a named addressee, you must not use, retain or
  disclose such information.
  Serco cannot guarantee that the e-mail or any attachments are
  free from viruses.
  Serco Group plc. Registered in England and Wales. No: 2048608
  Registered Office: Dolphin House, Windmill Road,
  Sunbury-on-Thames TW16 7HT, United Kingdom.
Received on Tue Jan 14 16:11:57 2003