Hi

> > But didn't Rafal mean that there is no need to _distribute_ also the
> > GPL'd wrappers. There could simply be an URL reference to the wrapper
> > distribution page for those who are interested in it.
> >
> > Wouldn't that work?
> > Neeme
>
> Yes. I could certainly host that code on working-dogs.com. It just could
not
> go into the Turbine CVS/website.
>

This could work - only include the SEARCH INTERFACE in Turbine, and host the
wrappers somewhere else.

I could also host GPL wrappers on our site, which separates it completely
from Turbine. Could not get a hold of Doug yet.  He hasn't answered his
e-mail in the last week!  I could also just Leave the Lucene wrappers for
now and first do the rest of the work.

Back to the good stuff.  I'm proposing a similar architecture for search
engines than what is currently used for databases.  That is to create a
standard Java INTERFACE through which turbine can access search engines.
The advantage being that search engine wrappers can be "plugged" into and
out of turbine without modifying existing code.  Also has the advantage that
someone can develop wrappers for GPL search engines that doesn't need to be
distributed with turbine :-).

At the moment I propose two interfaces to add search capability to turbine.
This is a first draft and I would appreciate any comments and suggestions.
It is not a service yet, but will probably be after some issues have been
resolved. These include the issue of how to implement pooling of connections
to the search engine. Maybe a generic pool class :-).


// First interface to access a search engine:
public interface Search
{
    // Open a connection to the search engine
    public boolean connect (String username, String password);

    // Select the library to search (most search engines have the concept
    // of "libraries" of indexed stuff, e.g. the server's hd in library 1,
    // the app's db in library 2, etc.)
    public boolean setLibrary (String library);

    // Get & Set any variables that are specific to a search engine
    // The wrapper could declare the "names" of these variables as static
    // final Strings. One could also use a Criteria kind of class that gets
    // passed in here with all necessary variables (e.g. searchterms,
    // numofresults, fuzzyspellingstyle, etc.)
    public void put (String name, String value);
    public String get (String name);

    // Does the search for a user query
    // The type of searches available will depend on the
    // underlying search engine: default = 0 (Types could include
    // boolean, concept, fuzzy, etc.)
    public boolean doSearch (String query, int type);

    // Get an enumeration of SearchResult (see next interface)
    public Enumeration getResults();
}


public interface SearchResult {

    // Get the field names that is available for this result
    public Enumeration getFields();

    // Get a value for a given field name
    public String get (String fieldname);
}

Regards
Leon




------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to