jmruiz@boe.es wrote:
> SWISHE::SwishOpen: Opens the index files and returns a handle.
> SWISHE::SwishSearch: Makes the search and returns the number
> of hits.
> SWISHE::SwishNext: Reads one result
> SWISHE:.SwishClose: Closes the handle
The structure looks very usable. We'll probably want some way to pass
options. But, that is a minor issue at this point.
A PHP interface might look like swishe_open(), swishe_search(),
swishe_next(), swishe_close(). PHP shares most of the PERL's language
constructs. The rest of the example code would be nearly identical to
PERL.
PHP EXAMPLE:
#!/usr/local/bin/php
$properties=""; # No properties
#$properties="prop1 prop2 prop3";
$handle=swishe_open("../src/index.swish");
$structure=1; # Related to -t option of swish-e
$words='test'; # search string
$num_results=swishe_search($handle,$words,$structure,$properties);
print "Search Results: $num_results\n";
while(list($rank,$filename,$title,$size,$prop1,$prop2,$prop3)=swishe_next($handle))
{
print "$rank $filename \"$title\" $size \"$prop1\" \"$prop2\"
\"$prop3\"\n";
}
:ELPMAXE PHP ;-)
> You can open as many handlers as you like.
> At this moment, there are some other things to do. The
> implementation is not thread-safe because there are several static
> variables defined in some of the functions of swish-e. It is also
> neccesary to check all the errors in a search in a better way (swish-
> e issues an exit after an error too often).
Dirk Nerinckx did some DLL work for Windows in a very early port. In
fact, we both were using SWISH-E as ISAPI modules under MS-IIS at the
time (albeit unreliably).
Dirk replaced all exit() calls with a C++ throw call in his code.
Something similar could probably be done which would be more portable.
http://sunsite.berkeley.edu/SWISH-E/Ports/Windows/
These two files:
nerinckx.txt
nerinckx.zip
--
,David Norris
Dave's Web - http://www.webaugur.com/dave/
Dave's Weather - http://www.webaugur.com/dave/wx
ICQ Universal Internet Number - 412039
E-Mail - dave@webaugur.com
"I would never belong to a club that would have me as a member!"
- Groucho Marx
Received on Wed Aug 2 10:26:59 2000