This is an extension library for Ruby to use libnmz which is C library of Namazu.
This supports Ruby 1.6/1.7, Namazu 2.0.x.
Extract to some directory and do:
$ ruby extconf.rb $ make # make site-install
Search::Namazu is copyrighted free software by Tietew. You can use/redistribute/modify it under the terms of Ruby or Namazu.
Tietew <URL:mailto:tietew@tietew.net>
require 'search/namazu' result = Search::Namazu::search( "foo and bar or baz not hoge", ['/var/namazu/index/1', '/var/namazu/index/2']) p result
search(query, indices, options = {})
Search using Namazu, and returns result as Search::Namazu::Result. query: Query string, indices: Array of index directory, options: Hash of options.
If fail to search, Search::Namazu::Error will be raised.
SUCCESS
ERR_*
Searching status. For more detail, see libnamazu.h.
Data
hlist
results
Array of Search::Namazu::ResultData of hit document.
hitnumlist
Array of Search::Namazu::HirnumData of hit num. Each element of the array matches element of indices when search method is called.
Data
score
Score
fields
Hash of fields
date
Date of document (Time object)
rank
Rank
method_missing(key)
Same as fields[key.to_s]
Data
word
Search word
hitnum
The number of document hit by the word
stat
Searching status
phrase
When phrase search, array of Search::Namazu::HitnumData of each word.
RuntimeError
stat
Searching status