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-ruby gem is a gem of Xapian's Ruby bindings, including a private build of xapian-core (the C++ library). The bundled Xapian version is 1.4.16 (released 2020-06-08). This is the current stable Xapian release, as of July 2020.

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

xapian-core gem

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

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 fork of the xapian-full gem by a frustrated xapian-full user. However, updates are very infrequent (nearly five years between the last two). Currently bundles xapian 1.4.11 (which was released 2019-03-02).

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 4 years ago Last modified on 09/07/20 02:27:48
Note: See TracWiki for help on using the wiki.