Skip to content

acrookston/fsearch

Repository files navigation

FSearch – MySQL full-text search for your Frog CMS

About

The FSearch plugin adds full-text search to your Frog CMS.
This plugin only works for MySQL based installations.

Created by Andrew Crookston at CA Systems
Email: andrew at casystems dot se
Web: http://www.casystems.se

MySQL full-text search is a good choice if your running your site on a co-hosted server, since these solutions don’t allow you to run external search engine software.

However if you are running a very large site or one with a lot of visitors the MySQL full-text search is probably not be the best option for you.
I recommend that you look into Solr, Sphinx or Xapian for better performance and functionality.

Enjoy!

How it works

For every page you want searchable, check the “Make this page searchable” checkbox.
When you save the page the Title and BODY page-part will be copied into a search-optimized text field and indexed by MySQL.

Read up on the MySQL full-text search over at mysql.com:
MySQL Full-Text
Boolean Queries

Installation

This plugin adds fields and indexes to your database tables so make sure you have a backup before activating the plugin!

Download

There are two ways of downloading FSearch:

1. Get the tarball
Download the tarball from here: http://github.com/acrookston/fsearch/tarball/master
Unpack the tarball in: [your_frog_installation]/frog/plugins/

2. OR With Git
To install FSearch make sure you have git installed on your system.
Then follow these easy instructions:


cd [your_frog_installation]/frog/plugins/
git clone git://github.com/acrookston/fsearch.git

Activate

Before you start
This guide is written as if FrogCMS was just installed and does not take any consideration to any changes you have made to your installation.

The examples in this README and included snippets will only work if you have turned on MOD_REWRITE
Please see Remove the question mark from the URL for instructions on how to do this.

1. Enter the admin page of your Frog installation and activate the plugin.

2. Create two snippets
First snippet, call it search-main and copy the contents of snippet-search-main.txt
Second snippet, call it search-form and copy the contents of snippets-search-form.txt

3. Create a search page
My recommendation is to use /search but you can use whatever URL you want. Just remember to update the URL in the search-main snippet to reflect your search page URL.
The body contents of your search page should be: <?php $this->includeSnippet('search-main'); ?>

Now your ready to go!

You may also add the search-form snippet to your header for a site-wide search form.

Changelog

2010-02-09

  • ADDED: Now rolles back database changes when disabling the plugin (this means all “Make page searchable” settings are lost when disabled).
  • BUGFIX: Now indexes titles and page part correctly
  • BUGFIX: Fixed bug when updating the page with searchable or not status. Was caused by the element being a select.

Road map

  • Support for searching multiple page parts.
  • Support optional Boolean Full-Text search (see MySQL website for details)

Disclaimer and License

Released under GPL License.
The source code is available at github: http://github.com/acrookston/fsearch/tree

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

About

MySQL full-text search plugin for Frog CMS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages