Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A fulltext indexing solution for plain Ruby and Ruby On Rails based on the Xapian library
Ruby JavaScript

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.bundle
examples
features
lib
spec
.gitignore
.rspec
CHANGELOG
Gemfile
LICENSE
README.rdoc
xapian_db.gemspec

README.rdoc

XapianDb

What's in the box?

XapianDb is a ruby gem that combines features of nosql databases and fultext indexing into one piece. The result: Rich documents and very fast queries. It is based on Xapian, an efficient and powerful indexing library. The gem is in very early development and not production ready yet.

XapianDb is inspired by xapian-fu and xapit. Thank you John and Ryan for your great work. It helped me learning to understand the xapian library and I borrowed an idea or two from you ;-)

Why yet another indexing gem?

In the good old days I used ferret and acts_as_ferret as my fulltext indexing solution and everything was fine. But time moved on and Ferret didn't.

So I started to rethink fulltext indexing again. I looked for something that

  • is under active development

  • is fast

  • is lightweight and easy to install / deploy

  • is framework and database agnostic and works with pure POROS (plain old ruby objects)

  • is configurable anywhere, not just inside the model classes; I think that index configurations should not be part of the domain model

  • supports document configuration at the class level, not the database level; each class has its own document structure

  • integrates with popular Ruby / Rails ORMs like ActiveRecord or Datamapper through an extensible plugin architecture

  • returns rich document objects that do not necessarily need a database roundtrip to render the search results (but know how to deliver the underlying object, if needed)

  • updates the index realtime (no scheduled reindexing jobs)

  • supports all major features of a full text indexer, namely wildcards!!

I tried hard but I couldn't find such a thing so I decided to write it, based on the Xapian library.

Getting started

1. Install Xapian if not already installed

To use xapian_db, make sure you have the Xapian library and ruby bindings installed. At the time of this writing, the newest release of Xapian was 1.2.3. You might want to adjust the URLs below to load the most current release of Xapian. The example code works for OSX. On linux you might want to use wget instead of curl.

A future release of xapian_db might include the Xapian binaries and make this step obsolete.

Install Xapian

curl -O http://oligarchy.co.uk/xapian/1.2.3/xapian-core-1.2.3.tar.gz
tar xzvf xapian-core-1.2.3.tar.gz
cd xapian-core-1.2.3
./configure --prefix=/usr/local
make
sudo make install

Install ruby bindings for Xapian

curl -O http://oligarchy.co.uk/xapian/1.2.2/xapian-bindings-1.2.3.tar.gz
tar xzvf xapian-bindings-1.2.3.tar.gz
cd xapian-bindings-1.2.3
./configure --prefix=/usr/local XAPIAN_CONFIG=/usr/local/bin/xapian-config
make
sudo make install
Something went wrong with that request. Please try again.