Archives
Admin / Logout

Adam Merrifield

a picture of me
I am a web designer, theme designer, professional photographer and internet personality. I make many pretty things and I write a lot of content for the internet.

I am one of those guys that, because of the industry I am in, need to be connected at all times. At any given moment you'll find me posting on a forum, updating with twitter, Digging things worthy of attention, uploading pictures, or tagging cool sites.

here i am

seyDoggy Systems:
This is home base, the corporate headquarters, the hub, if you will, seyDoggy.com.

seyDesign news:
these are the RapidWeaver related posts that originally appear in the seyDesign.com blog

Uploads from seyDoggy:
these are the pictures that I upload to flickr

Merrifield Photography:
as a professional photographer I my camera ready at Merrifield-Photography.com.

delicious.com/seydoggy:
these are the websites I want to share or revisit later on. I just tag them on delicious.com.

what i am

I am the owner and operator of seyDoggy Systems, a small theme, code and design outfit based in Kitchener, Ontario, Canada. We primarily develop web based technologies but have begun to dabble in the desktop realm.

what i do

I code like a fool. I design like a fool. I am happiest when I can split my time between the two (though I tire of Photoshop faster then I do TextMate or Terminal), and somehow I have managed to etch out a living doing so.

RapidWeaver tip: Add native search

One of the first things any visitor to a website looks for is a way to search within the site. One thing that has been sorely missing from RapidWeaver is native, integrated search functionality. Understandably it would be tough to get a desktop app to somehow construct a back end database on a remote server, though I bet it’s not impossible on mac since they run Unix, as do most server environments. But I think Dan and company have their hands full with more pressing, killer features.

That being said, I thought it was time to revisit this old thread and see how much further we could take this idea of integrated search. So without further delay:

How to add native search to your RapidWeaver site

  1. Create a new MySQL database on your host server.

    This will vary from host to host but here is a rough idea:
    1. Login into you hosting control panel.
    2. Go to you MySQL management area.
    3. Create a new MySQL host server (we’ll call ours “mysql.yourdomain.com”).
    4. Create a new MySQL database (call it “isearch” and apply it to the host server you just created).
    5. Create a new username and password, i.e. isearch_admin, yourpassword (write them down because we will need them later).
  2. Install iSearch2

    1. Download iSearch2.
    2. Unzip the package contents.
    3. Via an FTP client, upload the folder “isearch2″ and it’s content to the home folder of your host server, i.e. “public_html”, “html” or “home” depending on your host.
  3. Configure iSearch2

    Configure your basic settings in “isearch2/inc/config.inc.php”:
    1. $isearch_sql_server = 'mysql.yourdomain.com'; (depending on your host, this might be “localhost”)
    2. $isearch_sql_username = 'isearch_admin'; (this is the username I told you to write down ealier)
    3. $isearch_sql_password = 'yourpassword'; (and this is the password I told you to write down earlier)
    4. $isearch_sql_database = 'isearch'; (this is the name of the database we created)
    5. $isearch_admin_password = 'adminpassword'; (this is the password you will make up to administer iSearch from a browser)

    6. Note: Consult your hosts help documents if you have any difficulty in this area.

  4. Index your site

    iSearch2 needs to compile the contents of your site into an indexable database:
    1. In a web browser, go to “http://yourdomain.com/isearch2/admin” and login using the isearch admin password you created here.
    2. Enter your email address and home page URL.
    3. In the last large text box, enter the urls that you don’t wish index in the search database separated by a space. I highly recommend excluding all folders that contain xml or other files intended to be read as RSS. These will fair well in searches but will result in the user trying to open RSS feeds when they may not intend to do so or may not have a means of reading RSS (like Internet Explorer users)
    4. Click save.
    5. Click “Spider” and wait. If it’s a big site it will take a while.
    6. Test the service by going to “http://www.yourdomain.com/isearch2″ and performing a search for a common term on your site. Did it work? Good! Carry on.


    7. Note: To have iSearch2 stay up to date you can set a Unix “cron” job or Windows Scheduled Task on your server to run the spider engine. Use PHP from the command line as follows (replace “http://www.yourdomain.com” with the full file path to your sites root directory):

      Unix : /usr/bin/php -q /http://www.yourdomain.com/isearch2/admin/reindex.php cmd
      Windows : c:\php\php -q c:\http://www.yourdomain.com\isearch2\admin\reindex.php cmd


  5. Make a search page

    In RapidWeaver:
    1. In the lower left corner, click the “+” button and add an HTML page (top level is preferable).
    2. In the Page Inspector, set your name, folder and file names appropriately.
    3. In the content area paste in the following:



      Note: the %base_url% in the action attribute will allow RapidWeaver to write the proper path to the isearch program. Keep in mind that you have to properly set the base url in RapidWeaver (Site > Show Site Setup > Publishing) for this to work. It is assumed that you will enter your home domain there in this exact format: “http://www.yourdomain.com/” (note the trailing forward slash)

    4. Publish your new search page and give it a spin… Still working? Good! Carry on.
  6. Search all over

    Search from anywhere on you site by copying the code from here and pasting it anywhere on your site.
  7. Make it sexy

    You probably noticed the results page is nothing short of terrible looking. I bet you want to make it look like the rest of your site, right? Ok, here is how:
    1. Open the source of your published search page (the one you just finished making) in a text editor.
    2. Highlight from “<!DOCTYPE html PUBLIC...” to just before “<!-- iSearc search form -->” and copy it.
    3. Open the file “/isearch2/index.php” and replace from “<!DOCTYPE html PUBLIC...” (at line 19) to “</head>” (line 29) with the code you copied.
    4. Go back to source code of your search page and highlight and copy from the end of “</FORM>” to the end of the code.
    5. Next, go back to the file “/isearch2/index.php” and replace from “</body>” to “</html>” with code you just copied.
    6. Save you changes.


    7. Note: I advise that you put your RapidWeaver search page in a folder on the top level. This will prevent broken link in the code that you just copied and pasted.

      WARNING: It should also be noted that some RapidWeaver generated code, apostrophes in particular, can break the php code. I recommend doing a search and replace on the RapidWeaver code you pasted in and swap all apostrophes with
      .

  8. Style some more

    iSearch2 allows for some extensive control of it’s style. You can begin to control these styles by adding the following CSS selectors to either the styles.css in the theme, live on the site or directly into the file “/isearch2/index.php”:

  9. Configure some more

    Remember the admin panel (“http://yourdomain.com/isearch2/admin”)? If you poke around in there you can set a HUGE number of options that allow for differences in the way the results are delivered, advanced versus simple search, help menus, how partial results are handled… Go ahead and have fun with it.
  10. Some Examples

    To see this search engine in full effect try it out on seyDesign or on Merrifield Photography.
| Trackback

Comments are closed.

Powered by RapidWeaver, WP-Blog and WordPress 3.3.2