You know, I haven’t updated much.

The problem is, I don’t have much to publicly show. I did a lot of Rails reprogramming to enable security on a lower level. That way, it checks for permissions in the model instead of in the controller. I have a few qualms with the find() lookup, but it works and I’m not going to complain. It’s ugly and not very Ruby-esque, but it gets the job done. The update, create, and delete are very clean though. I can see why people really love Ruby!

Read more to help me with searching!

My next biggest challenge is to come up with a decent searching algorithm for the forum. The last one used MySQL’s match() and FULLTEXT queries, which is good for small projects, but not to search the entire forum! :O On the flip side, I’m amazed it actually didn’t cause that much of a disruption on the forum.

I’ve been trying to lookup for find searching algorithms on Google, and I can’t seem to find anything good. Perhaps Google is afraid of competition? :P The idea I have is to store a reference to each individual word to a post. For example, the table might look something like this:

  • Dog: posts #25,67,98
  • Cat: posts #25,75,86

Basically, it would pre-search for you, so when you search for Dog, it automatically knows the posts are in 25, 67, and 98, without actually looking at the contents of all the messages. This indexing would get kinda big on something the size of the forum

I found a more involved algorithm, but it’s the same idea basically. Does anybody else have any bright ideas?

1 Response to “You know, I haven’t updated much.”


  1. 1 MilesZS

    I thought about sending this to Reid, and having him forward the message to you, but this will do just as well:

    Look into Ferret, and the acts_as_ferret plugin. It is inspired by the Apache Lucene Java project. We use it at work (where we have over 80 tables and easily over 100,000 records of which I am currently aware, if those numbers mean anything), and it is very cool, and comes with a ton of features out of the box. Google Ferret and acts_as_ferret, and you should find a wealth of resources. You are also welcome to contact me directly, as I’ve got some bookmarks, I think.

    There are other gems/plugins, such as Sphinx, as well, but I know little about them. I haven’t had the chance, or the reason, to look into them.

    http://ferret.davebalmain.com/trac

Leave a Reply