|Install TSearch2 contrib module for Pg||Can be as easy as sudo yum install postgresql-contrib, or you may need to recompile PostgreSQL to include it. See <http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intro.html> for more details|
|Load the TSearch2 functions to you database||
% cat tsearch2.sql | psql <your database>
|Load your data using the pg adaptor:||
% bp_pg_bulk_load_gff.pl -c -d yeast saccharomyces_cerevisiae.gff
|Add GFF/TSearch2 specific modifications||
Execute a perl script like this one:
If at some point you add more data you your database, you need to run a similar script to the one above, only executing the update_TSearch2() method. Finally, if you want to remove the TSearch2 columns from your database and go back to using the pg adaptor, you can execute a script like the one above, only executing the remove_TSearch2() method.
You should know a few things about how searching with TSearch2 works in the GBrowse environment:
1. TSearch2 does not do wild cards, so you should encourage your users not to use them. If wild cards are used, the adaptor will fall back on an ILIKE search, which will be much slower. 2. However, TSearch2 does do word stemming. That is, if you search for copy, it will find copy, copies, and copied. 3. TSearch2 does not do phrase searching; all of the terms in the search string are ANDed together.
Special thanks to Russell Smithies and Paul Smale at AgResearch in New Zealand for giving me their recipe for doing full text indexing in a GFF database.
Please report bugs to the BioPerl and/or GBrowse mailing lists (<mailto:firstname.lastname@example.org> and <mailto:email@example.com> respectively).
Please see Bio::DB::GFF::Adaptor::dbi::pg for more information about tuning your PostgreSQL server for GFF data, and for general information about GFF database access, see Bio::DB::GFF.
Scott Cain, firstname.lastname@example.org
Title : search_notes Usage : @search_results = $db->search_notes("full text string",$limit) Function: Search the notes for a text string, using PostgreSQL TSearch2 Returns : array of results Args : full text search string, and an optional row limit Status : public
This is based on the mysql-specific method that makes use of the TSearch2 functionality in PosgreSQLs contrib directory. Given a search string, it performs a full-text search of the notes table and returns an array of results. Each row of the returned array is a arrayref containing the following fields:
Title : make_features_by_name_where_part Function: constructs a TSearch2-compliant WHERE clause for a name search Status : protected
Title : install_TSearch2 Function: installs schema modifications for use with TSearch2 Usage : $db->install_TSearch2 Status : public
Title : update_TSearch2 Function: Updates TSearch2 columns Usage : $db->update_TSearch2 Status : public
Title : remove_TSearch2 Function: Removes TSearch2 columns Usage : $db->remove_TSearch2 Status : public
|perl v5.20.3||BIO::DB::GFF::ADAPTOR::DBI::PG_FTS (3)||2016-04-05|