Skip to main content.
home | support | download

Back to List Archive

[swish-e] PHP Development

From: David Norris <dave(at)>
Date: Mon Sep 28 2009 - 21:54:51 GMT
I'm just curious what sort of PHP APIs and scripts developers would like to
see for Swish-e.  It has been more than a decade since I wrote Simple Web
Search <>.  It is an obsolete antique and I
think it may no longer function with the latest version of PHP.  I haven't
used it in a very long time but I still see it being used all over the web.
I'd really like to build something that shows people that search can go
beyond the old stodgy way of doing things.  Web browsers are so much more
useful these days and no one really takes advantage of that fact.  And
Swish-e can do so much if you just understand how to use it.

Does anyone use either of PHP extensions available?  (The one in our SVN
repo or the one the PECL folks wrote?)  If so, which one?  And is the API
generally useful for your needs?  I ask because I think it would be useful
for some people, me in particular, if there was a native PHP class to
implement a standard Swish-e API for PHP.  What I propose it would do is to
either pass-through to a compiled PHP extension or wrap around the Swish-e
executable.  If the extension is available then use that.  If its not
available then try to find the executable and use that.  Make sense?  It
could implement multiple backends, of course.  For example, there could be a
backend that passes through to a SOAP interface running on another server.
Effectively acting as a search load balancer.  This code could also
implement the SOAP interface itself so the same code is running everywhere.

Is there anyone interested in this stuff?

Here is a simple demonstration of what I use on my website and would like to
develop into something more feature complete...

Lets do a query for articles mentioning Windows written in 2008:
    View source and you will notice that the output is a (slapped together)
XML schema using XSLT to transform the display into XHTML.

    PHP code reveals I'm piping out to the swish-e executable and writing
XML using DOM Document:

    Then using XSL to Transform the XML into XHTML; javascript is used to
provide seemingly instantaneous query results:

You'll notice that result links have an anchor appended to them.  The
javascript code on the receiving end reads the anchor as if it were a query
and performs the same XML query outputting results to the sidebar to the
right of my blog content.

There are several obvious improvements to be made to this.  But I really
haven't spent much time working on it over the years.  Its does what I
absolutely need and not much more.  If I do spend time I'd like the input of

  David L Norris

Users mailing list
Received on Mon Sep 28 17:54:55 2009