Tuesday, July 29, 2008

Ultrasphinx on Centos

1. yum install bison
2. yum install gcc-c++
3. wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
4. tar xvf sphinx-x.y.z
5. cd sphinx.x.y.z
6. ./configure
7. make
8. sudo make install

You also need chronic and hpricot gems on your system.

Tuesday, July 22, 2008

Ultrasphinx Search Engine with Rails 2.0.2

ultrasphinx: Anonymous modules have no name to be referenced by

This error is caused due to the autoloading failing to load the required Ultrasphinx files in Rails 2.0.2. The following is the fix:

1. require 'ultrasphinx/fields' in ultrasphinx/configure.rb

2.

production.conf

source episodes_main
{
html_strip = 1
}

index main
{
strip_html = 0
}

3.
In environment.rb

config.after_initialize do
Ultrasphinx::Configure.load_constants
end

Notes:
git clone git://github.com/DrMark/ultrasphinx.git vendor/plugins/ultrasphinx
rm -rf vendor/plugins/ultrasphinx/.git

Tuesday, July 08, 2008

How Google reinvented Ruby Hash or Protocol Buffers by Google

I was laughing out aloud when I saw the following example on Protocol Buffers:

person {
name = "John Doe"
email = "jdoe@example.com"
}

How close is it to Ruby?

person => {
name => "John Doe"
email => "jdoe@example.com"
}