--- trunk/Tutorial.pod 2006/05/25 18:46:49 59 +++ trunk/Tutorial.pod 2006/08/07 22:07:49 71 @@ -3,6 +3,51 @@ This tutorial will try to show how easy it is to replace SQL constructs that use C<< where column like '%something%' >> with external full-text index using -L. +L. +In less then 10 minutes from installation to fill-text search-able table +(speed may vary somewhat, but it's really fast). + +=head2 Installation + + $ sudo apt-get install postgresql-8.1 postgresql-server-dev-8.1 \ + libdbd-pg-perl + $ sudo cpan Search::Estraier + +=head2 Compilation + + $ cd pgestraier + $ sudo make install + +This will just install library at right place without running tests or examples. + +=head2 Creating full-text index + +Let's assume you have database called C in which you have table +C which has fields title, lead, content, keywords and source which +should be search-able. + +You will have to do: + + $ ./bin/pgest-index.pl content --create news > search.sql + +That's it. Really. You will even get example SQL query to shoehorn into +your application. + +You can now connect to database using psql, edit search string in +C and try your new full-text index. + +However, you will notice that we indexed B field in table news, +which is wasteful (because other fields are ids of various things, +booleans and fields which aren't interesting for full-text search). + +So, we can do better: + + $ ./bin/pgest-index.pl content --create news \ + --sql="select id,title,lead,content,keywords from news" + +We added custom SQL query which will be used to produce full-text index and +triggers so that we touch only columns in which we are really interested. + +This time around that it! Enjoy.