Setup Xapian and Ruby binding on Ubuntu server

By taylor luk on August 17, 2009 @ 10:00 AM

Today, I need to get my Xapian setup with Ruby 1.9 on my Ubuntu 8.04 vps and there are very little documentation on setup Xapian and ruby, so I decide to share and cover some information on the setup process.

In the past I have introduced Xapit in a post Fulltext search your CouchDB in Ruby, It is a Xapian fulltext search toolkit for ruby and it's easy and extensible, also i have added a CouchDB adapter to Index your CouchDB database using Xapit.

Here is a list of documentation about installing Xapian,

Xapian

Latest ubuntu package for Xapian i can find is 1.0.4, so i decide to download the latest package of xapian-core and xapian-bindings from the official website.

xapian-core

wget http://oligarchy.co.uk/xapian/1.0.14/xapian-core-1.0.14.tar.gz
tar zxf xapian-core-1.0.14.tar.gz
cd xapian-core-1.0.14
./configure && make && sudo make install

xapian-ruby binding

xaipan bindings contains language binding to many languages including ruby, python and php.

wget http://oligarchy.co.uk/xapian/1.0.14/xapian-bindings-1.0.14.tar.gz
tar zxf xapian-bindings-1.0.14.tar.gz
cd xapian-bindings-1.0.14

./configure && make && sudo make install 

If you have a alternative ruby interpreter such as (ruby 1.9 or REE) then you need to pass in the location of your ruby interpreter during setup.

./configure RUBY=/opt/ruby1.9/bin/ruby1.9
make && sudo make isntall

Quick Test

A quick irb session will reveal if everything has gone smoothly.

irb1.9
irb(main:001:0>require 'xpaian'
=> true

Congratulations

Now you have successfully installed xapian and it's ruby binding. Checkout acts_as_xapian or xapit if you are looking for a fulltext search solution in your Rails application.


Bookmark and Share

Please leave a comment, so we can kick start a conversion...

blog comments powered by Disqus