Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (13 sloc) 0.371 kB
# Ilya Grigorik
#
# Ferret index demo
#
require 'ferret'
include Ferret
index = Index::Index.new()
index << {:title => "1", :content => "it is what it is"}
index << {:title => "2", :content => "what is it"}
index << {:title => "3", :content => "it is a banana"}
index.search_each('content:"banana"') do |id, score|
puts "Score: #{score}, #{index[id][:title]} "
end
Jump to Line
Something went wrong with that request. Please try again.