[Tutor] SwishE web interface

Reed L. O'Brien reedobrien at acm.org
Tue Jun 8 10:20:19 EDT 2004

I have an html page whose form calls the function in the following.

import SwishE


def search(searchWords):

     # make sure the user provided all the parameters
     if not (searchWords):
         return " Nothing to search for. Nothing Found."

     handle = SwishE.new('/usr/local/swish-e/index.swish-e')
     search = handle.search('')
     results = search.execute(searchWords)
#    return results.hits()
     for r in results:
         return r.getproperty('searchdocpath')

If I:
return results.hits()

for r in results:
         return r.getproperty('searchdocpath')

only returns the first.  I would like them all returned.  I have been 
playing around but am in a loop.  Any help would be appreciated.  I know 
it is a simple solution like converting to a dict or something.  I am 
humbled by the difficulty of programming.  This is my first non shell 

FreeBSD 5.2.1
apache 2.0.49
mod_python 3.1.3
SwishE 0.4



More information about the Tutor mailing list