March 2010 Archives

Upon launching (and tweaking) dfw, I learned a great deal about Solr and it's various and assorted CPAN modules supporting its use with Catalyst.  Solr is fairly nice, but I'm not entirely convinced it's worth the maintenance hassle unless you have a large volume of requests coming in for your search data. The small things that I got hung up on weren't really worth the hassle for a small, low traffic site like Denzel.  I'm still not a *huge* fan of hitting the database per search, so I looked into a few other solutions.


Sphinx looks pretty neat.  It's written in C, and has native support for MySQL indexing (you point the mysql client at the sphinx mysql emulator, if that's the proper term, and you can make SELECT *... statements just as you would connected to a typical mysqld).  This is really cool, since you could (potentially, this is all untested and pure theory) setup a DBIx::Class resultset/schema based on your search data (or just have a separate schema that connects to the sphinx instance) and do searches from there.  However, having recently played with Data::SearchEngine, I think it would be much cooler to write a subclass of Data::SearchEngine that does the search operations on your data set for you.  You get cool things like faceting, serialization, and an elapsed time count.  On top of that, it would be pretty trivial to wrap it in a Catalyst::Model so people that like to do $c->model('Sphinx') can do so.

Anyway, this is a rather scatterbrained post of mine I wanted to get out of my scatterbrained head before I forgot about it. Cold Hard Code just launched CodePeek which has some good examples of the aforementioned modules, most of which are in use in production code.

So I've been working on my "play" site for a couple months now, and since it's incarnation, have wanted to use Solr for indexing things from the file system and the database.  In front of me lay some seriously sweet options for doing such:
  • DBIx::Class::Indexer::WebService::Solr - this allows you to have your database insertions *automatically* indexed/inserted into the Solr index.  Perfect for adding documents into a Solr index that are also going into your database.
  • Catalyst::Model::WebService::Solr - Search your Solr index via the webservice through a convenient Catalyst::Model class. $c->model('YourSolrModel')->search($terms) and away!
So, having implemented these and a sane schema for Solr to look at, I will have denzelfuckingwashington.com up and at 'em in no time.  I love perl.

About this Archive

This page is an archive of entries from March 2010 listed from newest to oldest.

February 2010 is the previous archive.

April 2010 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Recent Photos

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.261