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):

#!/usr/bin/ruby1.9.1
require 'xapian-fu'
include XapianFu
db = XapianDb.new(:dir => '/var/lib/apt-xapian-index/index.1')
db.search(ARGV[0]).each do |match|
  puts match.data
end