Adventures into CouchDB and Rails

May 4, 2009

Quick Tip: CouchDB with Lucene Search

Filed under: CouchDB — Tags: , , , — zdzolton @ 4:13 pm

So, I’m still loving Bob Newson’s CouchDB-Lucene external integration.

Here’s a quick way to monkey-patch on a search method:

CouchRest::Database.class_eval do 
  def search query, options={} 
    CouchRest.get "#{@uri}/_fti?#{options.merge(:q => query).to_query}" 
  end 
end 

Advertisements

Blog at WordPress.com.