Which Ruby wrapper should I use?

If you want to access Xapian from Ruby, there are several wrappers available.

Xapian's own Ruby bindings

These bindings are a (largely automatic) translation of the C++ API into Ruby, with methods renamed to follow Ruby conventions. Some features (such as iterators) have been wrapped specially to give a more natural interface. Most of the interface simply mirrors the C++ API, and can be slightly clumsy to use from Ruby. There is currently little documentation specific to the Ruby bindings, but the C++ API documentation gives a good overview. The bindings allow complete access to all of Xapian's features.

All the other known Xapian Ruby wrappers are implemented on top of these bindings, so you will need to install them even if you plan to use a higher level interface. The API is stable, and follows the same deprecation policy as Xapian's C++ API to ensure a reasonably easy upgrade path between releases.

xapian-core gem

The confusingly-named "xapian-core" gem actually contains Xapian's Ruby bindings which includes a private build of xapian-core (the C++ library). The bundled Xapian version is currently 1.4.2 (released 2016-12-26) - not the latest 1.4.x release, but it is at least from the current release branch.

If you want a gem of Xapian's Ruby bindings, this currently seems the best option.

xapian-ruby gem is a gem of Xapian's Ruby bindings, including a private build of xapian-core (the C++ library). However, has not been updated since January 2016 and the bundled Xapian version is 1.2.22, which is a retired release branch, and no even the latest version from that branch.

We don't recommend using this gem.

xapian-full gem is also a gem of Xapian's Ruby bindings, and also includes a private build of xapian-core. However, it is not well maintained - it is painfully out of date (it packages 1.2.3 which was released 2010-08-24), and all previous versions were of the 1.1.3 development snapshot (we do not recommend packaging development snapshots unless they are clearly marked as such, which it wasn't).

We really don't recommend using this gem.

xapian-full-alaveteli gem is a version of the xapian-full gem updated by a frustrated xapian-full user. However, they've not continued to update their fork, and the latest version bundles xapian 1.2.21 (which was released 2015-05-20).

We don't recommend using this gem.


From the README:

XapianFu is a Ruby library for working with Xapian databases. It builds on the GPL licensed Xapian Ruby bindings but provides an interface more in-line with "The Ruby Way"(tm).

There is a useful introductory blog article about Xapian Fu.

xapian-fu no longer seems to be actively maintained.


From the README:

Xapit (pronounced "zap it") is a high level interface for working with a Xapian database.

Note: This project is early in development and the API is subject to change.

Xapit seems to be aimed at Ruby on Rails.

This project no longer seems to be actively maintained.

CouchDB Xapian

CouchDB Xapian is a search interface to CouchDB documents, that uses the Ruby Xapian bindings.

This project was hosted on gitorious, but the link no longer works. It doesn't seem to have a new home.


dm-xapian is a Merb plugin to index your Ruby on Rails DataMapper models with Xapian. Seems to be a rewrite of/based on acts_as_xapian.

This article has more information:

This project no longer seems to be actively maintained.


Acts as Xapian is a search plugin for Ruby on Rails.

It was originally developed by Francis Irving, but he has been distracted into saving the world. There was some further work on it by others, but it now seems to be unmaintained.

FAQ Index

Last modified 16 months ago Last modified on 25/06/18 03:51:59