Ruby Xapian Fu

April 26th, 2010

Ruby has been a joy for me to learn and that positive experience has led me to try certain tasks I had previously hesitated to undertake.

Building a Xapian database for searching, for instance. I first tried using the standard Xapian bindings, but then I found xapian-fu, a much more Rubyish gem.

It works fine with ruby 1.9.1 for me and is quite speedy. Here's a very simple example for a search (using the databases generated by the debian package apt-xapian-index):

require 'xapian-fu'
include XapianFu
db = => '/var/lib/apt-xapian-index/index.1')[0]).each do |match|
Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022