New features on SPhred.com

5 11 2007

First, A big thanks to all the guys out there for registering and sending invitation to their friends/relatives to try out sphred.com

SPhred is currently in very early stages, like what other sites say ‘in beta’.

A few things are added on SPhred in the last couple of days:

1) Earlier you first had to create a post and then could add tags to it but now you can add tags while creating a post.

2) Now you can put a face to your name i.e. add a picture. This functionality is available by going to your profile page. The option is given just below “Profile for your name”. You can access your profile page after signing in by clicking on your email address part of ‘Signed in as your email address‘.

3) Page to view users who sphredded an item has been redone and looks much better now (atleast I think so). Have a look by clicking on the number of users who sphreaded an item. Or you can directly go here http://sphred.com/users_sphredding/9-tutsbuzzcom

4) Search is functional now though currently it only looks for the search term in a Sphred Item’s title or description.

6) Comments look much better now as you can see the picture of people who posted comments.

I would love to hear your feedback or suggestions i.e. what you would like to have on sphred and what you think isn’t working or won’t work.

Once again thank you all for using sphred.





Full text search using Ferret (acts_as_ferret) with rails

25 10 2007

I recently started working with acts_as_ferret so I thought to put together a little how to:

Assuming you already have ruby on rails environment set up

1) To install it run gem install ferret
this will prompt you to select a gem for your platform

2) go to your rails project root directory and run
script/plugin install svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret

3) Add require 'acts_as_ferret' to your config/environment.rb

4) Resart your app

To add full text search capability to a model simply add this within your model

acts_as_ferret

To add full text search capability to a model but on some specific attributes/field_names add this

acts_as_ferret :fields => [ :author, :content ]

How to perform search?

If your model name is location then you can use

Location.find_by_contents(search_criteria)

Note: If you have very large number of records then it might take a while to run your search for the first time as it indexes all the records

If you want to use pagination or multiple models then use
Location.find_with_ferret query, :page => params[:page], :per_page => 10,
:multi => [ Model_2, Model_3 ]

I will be adding some advanced stuff later on …


Sign up and be a part of SPhred.com and don’t forget to invite your friends ;o)