<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Install Full Text Search</title><meta name="generator" content="DocBook XSL Stylesheets V1.62.0"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="install-more-software.html" title="Appendix�B.�Install additional supporting software"><link rel="previous" href="install-nspam.html" title="Install nspam"><link rel="next" href="install-nsopenssl.html" title="Install nsopenssl"><link rel="stylesheet" href="openacs.css" type="text/css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" border="0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="install-nspam.html">Prev</a> </td><th width="60%" align="center">Appendix�B.�Install additional supporting software</th><td width="20%" align="right"> <a accesskey="n" href="install-nsopenssl.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="install-full-text-search"></a>Install Full Text Search</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="install-openfts"></a>Install OpenFTS module</h3></div></div><div></div></div><a class="indexterm" name="id2850158"></a><p>If you want full text search, and you are running PostgreSQL, install this module to support FTS.  Do this step after you have installed both PostgreSQL and
      AOLserver.  You will need the <a href="individual-programs.html#openfts-download">openfts
      tarball</a> in <tt class="computeroutput">/tmp</tt>.</p><div class="orderedlist"><ol type="1"><li><p>Install Tsearch.  This is a PostgreSQL module that
	  OpenFTS requires.</p><pre class="screen">[root@yourserver root]# <b class="userinput"><tt>su - postgres</tt></b>
[postgres@yourserver pgsql]$ <b class="userinput"><tt>cd /usr/local/src/postgresql-7.2.4/contrib/tsearch/</tt></b>
[postgres@yourserver tsearch]$ <b class="userinput"><tt>make</tt></b>
sed 's,MODULE_PATHNAME,$libdir/tsearch,g' tsearch.sql.in &gt;tsearch.sql
/usr/bin/flex  -8 -Ptsearch_yy -o'parser.c' parser.l<span class="emphasis"><em>(many lines omitted)</em></span>
rm -f libtsearch.so
ln -s libtsearch.so.0.0 libtsearch.so
[postgres@yourserver tsearch]$ <b class="userinput"><tt>make install</tt></b>
mkdir /usr/local/pgsql/share/contrib
mkdir /usr/local/pgsql/doc/contrib
(2 lines omitted)
/bin/sh ../../config/install-sh -c -m 755 libtsearch.so.0.0 /usr/local/pgsql/lib/tsearch.so
[postgres@yourserver tsearch]$ <b class="userinput"><tt>exit</tt></b>
logout

[root@yourserver root]#
<span class="action"><span class="action">su - postgres
cd /usr/local/src/postgresql-7.2.4/contrib/tsearch
make
make install
exit</span></span></pre></li><li><p>Unpack the OpenFTS tarball and compile and install
              the driver.</p><pre class="screen">[root@yourserver root]# <b class="userinput"><tt>cd /usr/local/src</tt></b>
[root@yourserver src]# <b class="userinput"><tt>tar xzf /tmp/Search-OpenFTS-tcl-0.3.2.tar.gz</tt></b>
[root@yourserver src]# <b class="userinput"><tt>cd /usr/local/src/Search-OpenFTS-tcl-0.3.2/</tt></b>
[root@yourserver Search-OpenFTS-tcl-0.3.2]# <b class="userinput"><tt>./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver --with-tcl=/usr/lib/</tt></b>
checking prefix... /usr/local
checking for gcc... gcc
<span class="emphasis"><em>(many lines omitted)</em></span>
configure: creating ./config.status
config.status: creating Makefile.global
[root@yourserver Search-OpenFTS-tcl-0.3.2]#<b class="userinput"><tt> make</tt></b>
(cd parser; make all)
make[1]: Entering directory `/usr/local/src/Search-OpenFTS-tcl-0.3.2/parser'
<span class="emphasis"><em>(many lines omitted)</em></span>
packages provided were {Lingua::Stem::Snowball 0.3.2}
processed fts_base_snowball.tcl
[root@yourserver Search-OpenFTS-tcl-0.3.2]# <b class="userinput"><tt>cd aolserver</tt></b>
[root@yourserver aolserver]# <b class="userinput"><tt>make</tt></b>
gcc -c -fPIC  -DPACKAGE=\"OPENFTS\" -DVERSION=\"0.3.2\" -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STR
<span class="emphasis"><em>(many lines omitted)</em></span>
n_stem.o italian_stem.o norwegian_stem.o portuguese_stem.o russian_stem.o nsfts.o  -o nsfts.so
[root@yourserver aolserver]# <b class="userinput"><tt>cp nsfts.so /usr/local/aolserver/bin/</tt></b>
[root@yourserver aolserver]#
<span class="action"><span class="action">cd /usr/local/src 
tar xzf /tmp/Search-OpenFTS-tcl-0.3.2.tar.gz
cd /usr/local/src/Search-OpenFTS-tcl-0.3.2/
./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver --with-tcl=/usr/lib/
make
cd aolserver
make
cp nsfts.so /usr/local/aolserver/bin
</span></span></pre></li><li><p>Build some supplemental modules.</p><pre class="screen">[root@yourserver aolserver]# <b class="userinput"><tt>cd /usr/local/src/Search-OpenFTS-tcl-0.3.2</tt></b>
[root@yourserver Search-OpenFTS-tcl-0.3.2]# <b class="userinput"><tt>cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.2.4/contrib</tt></b>
[root@yourserver Search-OpenFTS-tcl-0.3.2]# <b class="userinput"><tt>cd /usr/local/src/postgresql-7.2.4/contrib/pgsql_contrib_openfts</tt></b>
[root@yourserver pgsql_contrib_openfts]#<b class="userinput"><tt> make</tt></b>
sed 's,MODULE_PATHNAME,$libdir/openfts,g' openfts.sql.in &gt;openfts.sql
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -fpic -I. -I../../src/include   -c -o openfts.o openfts.c
gcc -shared -o openfts.so openfts.o
rm openfts.o
[root@yourserver pgsql_contrib_openfts]# <b class="userinput"><tt>su postgres</tt></b>
[postgres@yourserver pgsql_contrib_openfts]$ <b class="userinput"><tt>make install</tt></b>
/bin/sh ../../config/install-sh -c -m 644 openfts.sql /usr/local/pgsql/share/contrib
/bin/sh ../../config/install-sh -c -m 755 openfts.so /usr/local/pgsql/lib
/bin/sh ../../config/install-sh -c -m 644 ./README.openfts /usr/local/pgsql/doc/contrib
[postgres@yourserver pgsql_contrib_openfts]$<b class="userinput"><tt> exit</tt></b>
[root@yourserver pgsql_contrib_openfts]#
<span class="action"><span class="action">cd /usr/local/src/Search-OpenFTS-tcl-0.3.2
cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.2.4/contrib
cd /usr/local/src/postgresql-7.2.4/contrib/pgsql_contrib_openfts
make
su postgres
make install
exit</span></span></pre></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="install-openfts-postgres"></a>Install OpenFTS prerequisites in PostgreSQL instance</h3></div></div><div></div></div><a class="indexterm" name="id2850417"></a><p>If you are installing Full Text Search, add required
        packages to the new database.  (In order for full text search
        to work, you must also <a href="install-full-text-search.html#install-openfts" title="Install OpenFTS module">install</a> the PostgreSQL
        OpenFTS module and prerequisites.)</p><pre class="screen">[service0@yourserver service0]$ <b class="userinput"><tt>/usr/local/pgsql/bin/psql <span class="replaceable"><span class="replaceable">service0</span></span> -f /usr/local/src/postgresql-7.2.4/contrib/tsearch/tsearch.sql</tt></b>
BEGIN
CREATE
<span class="emphasis"><em>(many lines omitted)</em></span>
INSERT 0 1
COMMIT
[service0@yourserver service0]$ <b class="userinput"><tt>/usr/local/pgsql/bin/psql <span class="replaceable"><span class="replaceable">service0</span></span> -f /usr/local/src/postgresql-7.2.4/contrib/pgsql_contrib_openfts/openfts.sql</tt></b>
CREATE
CREATE
[service0@yourserver service0]$
<span class="action"><span class="action">/usr/local/pgsql/bin/psql <span class="replaceable"><span class="replaceable">service0</span></span> -f /usr/local/src/postgresql-7.2.4/contrib/tsearch/tsearch.sql
/usr/local/pgsql/bin/psql <span class="replaceable"><span class="replaceable">service0</span></span> -f /usr/local/src/postgresql-7.2.4/contrib/pgsql_contrib_openfts/openfts.sql</span></span></pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="enable-openfts"></a>Enable OpenFTS in config.tcl</h3></div></div><div></div></div><p>If you have <a href="install-full-text-search.html#install-openfts" title="Install OpenFTS module">installed OpenFTS</a>, you can enable it for this service.  Uncomment this line from <tt class="computeroutput">config.tcl</tt>.  (To uncomment a line in a tcl file, remove the <tt class="computeroutput">#</tt> at the beginning of the line.)</p><pre class="programlisting">#ns_param   nsfts           ${bindir}/nsfts.so</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="install-fts-engine"></a>Install Full Text Search Engine</h3></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><p>Click <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Package Manager</span></span></tt> on the right side of the default home page.  If prompted, log in with the account and password you entered during install.</p></li><li><p>Click on the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Install
packages</span></span></tt> link.</p></li><li><p>On the next screen, after it loads, click on <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Uncheck all boxes</span></span></tt>, then click the checkbox next to <tt class="computeroutput"><span class="guilabel"><span class="guilabel">OpenFTS Driver 4.2</span></span></tt>.  Then click <tt class="computeroutput"><span class="guibutton"><span class="guibutton"><u><span class="accel">N</span></u>ext</span></span></tt>. </p></li><li><p>Click <tt class="computeroutput"><span class="guibutton"><span class="guibutton">Install Packages</span></span></tt></p></li><li><p>Restart the service.</p><pre class="screen">[service0@yourserver service0]$ <b class="userinput"><tt>svc -t /service/<span class="replaceable"><span class="replaceable">service0</span></span></tt></b>
[service0@yourserver service0]$</pre></li><li><p>Wait a minute, then browse back to the home page.</p></li><li><p>Click on <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Site Map</span></span></tt> on the top right side of the screen.</p></li><li><p>Mount the OpenFTS Full Text Search Engine in the site map.</p><div class="orderedlist"><ol type="a"><li><p>Click the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">new sub folder</span></span></tt> link on the "/" line, the first line under Main Site:/.</p></li><li><p>Type <b class="userinput"><tt>openfts</tt></b>
and click <tt class="computeroutput"><span class="guibutton"><span class="guibutton">New</span></span></tt>.</p></li><li><p>On the new <tt class="computeroutput"><span class="guilabel"><span class="guilabel">openfts</span></span></tt> line, click the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">mount</span></span></tt> link.</p></li><li><p>Click <tt class="computeroutput"><span class="guilabel"><span class="guilabel">OpenFTS
Driver</span></span></tt>.</p></li><li><p>On the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">openfts</span></span></tt> line, click <tt class="computeroutput"><span class="guilabel"><span class="guilabel">set parameters</span></span></tt>.</p></li><li><p>Change <tt class="computeroutput"><span class="guilabel"><span class="guilabel">openfts_tcl_src_path</span></span></tt> to <b class="userinput"><tt>/usr/local/src/Search-OpenFTS-tcl-0.3.2/</tt></b> and click <tt class="computeroutput"><span class="guibutton"><span class="guibutton">Set Parameters</span></span></tt>
              </p></li></ol></div></li><li><p>Mount the Search interface in the site map.</p><div class="orderedlist"><ol type="a"><li><p>Click the
<tt class="computeroutput"><span class="guilabel"><span class="guilabel">new sub folder</span></span></tt> link on the
Main Site line. </p></li><li><p>Type <b class="userinput"><tt>search</tt></b>
and click <tt class="computeroutput"><span class="guibutton"><span class="guibutton">New</span></span></tt>. </p></li><li><p>Click the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">new
application</span></span></tt> link on the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">search</span></span></tt>
	  line. </p></li><li><p>Type <b class="userinput"><tt>search</tt></b>
where it says
<tt class="computeroutput"><span class="guilabel"><span class="guilabel">untitled</span></span></tt>, choose
<tt class="computeroutput"><span class="guilabel"><span class="guilabel">search</span></span></tt> from the
drop-down list, and click
<tt class="computeroutput"><span class="guibutton"><span class="guibutton">New</span></span></tt>.
</p></li></ol></div></li><li><p>Restart the service.</p><pre class="screen">[service0@yourserver service0]$ <b class="userinput"><tt>svc -t /service/<span class="replaceable"><span class="replaceable">service0</span></span></tt></b>
[service0@yourserver service0]$</pre></li><li><p>Wait a minute, then click on <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Main Site</span></span></tt> at the top of the page.</p></li><li><p>Initialize the OpenFTS Engine.  This creates a set of tables in the database to support FTS.</p><p>Near the bottom of the page, click on the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">OpenFTS Driver</span></span></tt> link. Click on <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Administration</span></span></tt>.
Click on <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Initialize OpenFTS Engine</span></span></tt>. 
Click <tt class="computeroutput"><span class="guibutton"><span class="guibutton">Initialize OpenFTS Engine</span></span></tt>. </p></li><li><p>Add the FTS Engine service contract</p><div class="orderedlist"><ol type="a"><li><p>Click on the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">Main
Site</span></span></tt>. </p></li><li><p>Click on the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">ACS
Service Contract</span></span></tt> link near the bottom of the home page. </p></li><li><p>On the <tt class="computeroutput"><span class="guilabel"><span class="guilabel">FtsEngineDriver</span></span></tt>
line, click
<tt class="computeroutput"><span class="guilabel"><span class="guilabel">Install</span></span></tt>.
</p></li></ol></div></li><li><p>Restart the service.</p><pre class="screen">[service0@yourserver service0]$ <b class="userinput"><tt>svc -t /service/<span class="replaceable"><span class="replaceable">service0</span></span></tt></b>
[service0@yourserver service0]$</pre></li><li><p>Test FTS.  (INCOMPLETE).  Add a package that supports search,like "note," add some content, and search for it.</p></li></ol></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="install-nspam.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="install-nsopenssl.html">Next</a></td></tr><tr><td width="40%" align="left">Install nspam </td><td width="20%" align="center"><a accesskey="u" href="install-more-software.html">Up</a></td><td width="40%" align="right"> Install nsopenssl</td></tr></table><hr><address><a href="mailto:docs@openacs.org">docs@openacs.org</a></address></div><a name="comments"></a><center><a href="http://openacs.org/doc/install-full-text-search.html#comments">View comments on this page at openacs.org</a></center></body></html>