<?xml version="1.0"?>
<rss version="2.0">
  <channel><title>FullText</title><link>http://bill.welliver.org//space/pike/Fins/FullText</link><description>You can download a copy of the Fins FullText application &lt;a href="here" class="wiki_link_external" &gt;http://hww3.riverweb.com/dist/Fins/FullText.zip&lt;/a&gt;. You'll also need &lt;a href="/space/pike/Fins"&gt;Fins&lt;/a&gt; and the &lt;a href="Public.Xapian" class="wiki_link_external" &gt;http://modules.gotpike.org/getmodule.pike/Public.Xapian&lt;/a&gt; module for Pike installed.&lt;p class="paragraph"/&gt;
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:&lt;p class="paragraph"/&gt;
&lt;div class="code"&gt;&lt;pre&gt;&lt;pre&gt;&#xD;
  pike -x fins start FullText --port 8901&#xD;
&lt;/pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="paragraph"/&gt;
&#xD;
If all goes well, the index directory should be created, and FullText will be listening for XMLRPC requests on port 8901.&lt;p class="paragraph"/&gt;
&lt;b class="bold"&gt;Creating an index&lt;/b&gt;&lt;p class="paragraph"/&gt;
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.&lt;p class="paragraph"/&gt;
For example, we can create an index whose handle is this url:&lt;p class="paragraph"/&gt;
&lt;div class="code"&gt;&lt;pre&gt;&lt;pre&gt;&#xD;
&amp;gt; &lt;b&gt;&lt;font color=darkgreen&gt;object &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;x&lt;/font&gt;&lt;/b&gt; = Protocols.XMLRPC.Client(&lt;i&gt;&lt;font color=darkred&gt;"http://localhost:8124/update/"&lt;/font&gt;&lt;/i&gt;);&#xD;
&amp;gt; x&amp;#91;&lt;i&gt;&lt;font color=darkred&gt;"new"&lt;/font&gt;&lt;/i&gt;](&lt;i&gt;&lt;font color=darkred&gt;"http://my.url.com"&lt;/font&gt;&lt;/i&gt;);&#xD;
(2) Result: ({ &lt;font color=red&gt;/* 1 element */&lt;/font&gt;&#xD;
                0&#xD;
            })&#xD;
&lt;/pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="paragraph"/&gt;
&#xD;
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:&lt;p class="paragraph"/&gt;
&lt;div class="code"&gt;&lt;pre&gt;&lt;pre&gt;&#xD;
&lt;font color=red&gt;// add a new document to the index.&#xD;
&lt;/font&gt;&lt;font color=red&gt;// returns the document's uuid.&#xD;
&lt;/font&gt;&lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;add&lt;/font&gt;&lt;/b&gt;(&lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;index&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;title&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;int &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;date&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;contents&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;handle&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;string&lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;|void&lt;/font&gt;&lt;/b&gt; excerpt)&#xD;
&lt;b&gt;&lt;font color=darkgreen&gt;int &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;delete_by_uuid&lt;/font&gt;&lt;/b&gt;(&lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;index&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;uuid&lt;/font&gt;&lt;/b&gt;)&#xD;
&lt;b&gt;&lt;font color=darkgreen&gt;int &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;delete_by_handle&lt;/font&gt;&lt;/b&gt;(&lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;index&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;handle&lt;/font&gt;&lt;/b&gt;)&#xD;
&lt;b&gt;&lt;font color=darkgreen&gt;void &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;new&lt;/font&gt;&lt;/b&gt;(&lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;index&lt;/font&gt;&lt;/b&gt;)&#xD;
&lt;/pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="paragraph"/&gt;
&lt;p class="paragraph"/&gt;
The search controller provides the following method:&lt;p class="paragraph"/&gt;
&lt;div class="code"&gt;&lt;pre&gt;&lt;pre&gt;&#xD;
&lt;b&gt;&lt;font color=darkgreen&gt;array &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;search&lt;/font&gt;&lt;/b&gt;(&lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;index&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;query&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;string &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;field&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;int &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;start&lt;/font&gt;&lt;/b&gt;, &lt;b&gt;&lt;font color=darkgreen&gt;int &lt;/font&gt;&lt;/b&gt;&lt;b&gt;&lt;font color=darkbrown&gt;max&lt;/font&gt;&lt;/b&gt;)&#xD;
&lt;/pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="paragraph"/&gt;
</description><generator>Fins 0.9.7</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs></channel>
</rss>
