electronic.alchemy :: FullText
electronic.alchemy
where the past meets the future
pike > Fins > FullText

FullText

Created by hww3. Last updated by hww3, 11 years ago. Version #3.

You can download a copy of the Fins FullText application http://hww3.riverweb.com/dist/Fins/FullText.zip. You'll also need Fins and the http://modules.gotpike.org/getmodule.pike/Public.Xapian module for Pike installed.

FullText will create an index directory called "ft" wherever you run it from, so you should always change directories to the same place before you start it. There are no settings, so just fire it up:

  pike -x fins start FullText --port 8901

If all goes well, the index directory should be created, and FullText will be listening for XMLRPC requests on port 8901.

Creating an index

FullText is capable of hosting multiple independent indices at the same time, but does not come configured with an index. So, the first thing we need to do once we start FullText is to create a new index. To do this, we make an XMLRPC call to the "/update/" url (note that the trailing slash is necessary here), and call the "new" function; passing the name of the index to create.

For example, we can create an index whose handle is this url:

> object x = Protocols.XMLRPC.Client("http://localhost:8124/update/");
> x["new"]("http://my.url.com");
(2) Result: ({ /* 1 element */
                0
            })

The FullText application provides 2 endpoint urls, the update url, located at "/update/", and the search url, located at "/search/". The update controller provides the following API:

// add a new document to the index.
// returns the document's uuid.
string add(string index, string title, int date, string contents, string handle, string|void excerpt)
int delete_by_uuid(string index, string uuid)
int delete_by_handle(string index, string handle)
void new(string index)

The search controller provides the following method:

array search(string index, string query, string field, int start, int max)

Not categorized | RSS Feed | BackLinks

comments powered by Disqus