| KTiny documentation | ||
|---|---|---|
| Prev | Chapter 5. Server modules | |
The full text search module offers the possibility of searching anything in the database like the user is used in web searchers. As the module uses the full text searching capabilities of PostgreSQL, the administrator can tune the system to provide great results, by setting different priorities to different fields or by using dictionaries and stemmers. For example, one can make the search for the word 'using', return any document that contains the words 'use', 'using' and 'used'.

Full text search works very well with the Smart Attach module, meaning that you can index meta information automatically extracted from attached documents.
Before you can use this module you'll need to satisfy two dependencies:
TSearch2. TSearch2 adds full text search capabilities to PostgreSQL. Note that since version 8.3 PostgreSQL has TSearch2 included into core, so you don't need to do anything. Otherwise, you'll need to install it which usually means compiling (if your distribution didn't do it for you, and add the support to the database with psql database < tsearch2.sql. (http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/)
PL/PythonU. As Full text search trigger mechanism uses Python on the database you'll need to install Python on the database. Note the U stands for Untrusted, as Python is classified as an untrusted language in PostgreSQL. In the future we'll probably offer the chance of choosing between PL/PythonU or PL/SQL triggers.
![]() | In both cases it's possible to add support to a single database or to all newly created databases by adding TSearch2 or Python support to database template1, which is used to create new databases in PostgreSQL (unless another template is specified). This module also uses Psycopg2 in the trigger and thus such a package needs to be installed in the server where PostgreSQL resides. Psycopg2 is used to quote field values and avoid SQL injection. |
Once you've installed the dependencies and the module via Administration - Module Administration - Modules, you need to configure which fields you want to be indexed. The module will add a new section in Administration - Configuration - Full Text Search.