John Leach

Tag: search

Full text indexing of syslog messages with Riak

Created · Tech

I've just released a little tool I wrote called riak-syslog which takes your syslog messages and puts them into a Riak cluster and then lets you search them using Riak's full text search.

Rather than re-implement the wheel, riak-syslog expects that a syslog daemon will handle receiving syslog messages and will be able to provide them in a specific format - there is documentation on getting this running with rsyslog on Ubuntu.

Continue reading “Full text indexing of syslog messages with Riak” →

Indexing syslog messages with solr

Created · Tech · 1 comment

I've been thinking about centralized indexing and searching of logs for a while and the other day I came across a project called Graylog2 that does just that. It provides a service to receive messages over the network (in a couple of formats, including syslog) and writes them into mongodb. It then has a rails application that lets you browse and search the logs.

Continue reading “Indexing syslog messages with solr” →

Xapian Fu: Full Text Indexing in Ruby

Created · Last updated · Ruby, Tech

Xapian is an Open Source Search Engine Library written in C++. It has Ruby bindings, but they're generated with SWIG, so they basically just mirror the C++ bindings - not very Ruby-like (and pretty ugly).

Being a self-confessed full text indexing nerd and a Ruby-lover, I wrote Xapian Fu: a library to provide access to Xapian that is more in line with "The Ruby Way".

I started writing Xapian Fu exactly a year ago today but left it for a couple of months, then restarted work on it on the train on the way back from the 2009 Scotland on Rails conference.  Development was test driven, so it's got an extensive test suite (using rspec).  Documentation is in rdoc and is quite detailed.  As of the latest version, it supports Ruby 1.9 too.

Xapian Fu basically gives you a Hash interface to Xapian - so you get a persistent Hash with full text indexing built in (and ACID transactions!).

Example

For example, create a database called example.db, put three documents into it and search them and print the results:

  require 'xapian-fu'
  include XapianFu
  db = XapianDb.new(:dir => 'example.db', :create => true,
                    :store => [:title, :year])
  db << { :title => 'Brokeback Mountain', :year => 2005 }
  db << { :title => 'Cold Mountain', :year => 2004 }
  db << { :title => 'Yes Man', :year => 2008 }
  db.flush
  db.search("mountain").each do |match|
    puts match.values[:title]
  end

There are of course a whole bunch more examples in the documentation.

Continue reading “Xapian Fu: Full Text Indexing in Ruby” →

My NWRUG Ferret Talk

Created · Ruby on Rails, Tech · 2 comments

I did a short talk on Ferret, the Ruby "Information Retreival Library", at the North West Ruby Users Group last Thursday.  We had a bit of a theme too, with Will Jessop speaking about Sphinx and Asa Calow speaking about Solr.

I got to have a bit of a nosey around the Manchester BBC building too - though I was worried I'd open the wrong door and end up on TV. Didn't fancy having to apologise to Jeremy Paxman.

Continue reading “My NWRUG Ferret Talk” →