Parent

DataMapper::Adapters::FerretAdapter::LocalIndex

Public Class Methods

new(options) click to toggle source
# File lib/ferret_adapter/local_index.rb, line 4
def initialize(options)
  @options = options
  @options = { :path => @options[:path], :key => [:id, :_type] }
  create_or_initialize_index
end

Public Instance Methods

[](id) click to toggle source
# File lib/ferret_adapter/local_index.rb, line 22
def [](id)
  @index[id]
end
add(doc) click to toggle source
# File lib/ferret_adapter/local_index.rb, line 10
def add(doc)
  @index << doc
end
delete(query) click to toggle source
# File lib/ferret_adapter/local_index.rb, line 14
def delete(query)
  @index.query_delete(query)
end
search(query, options = {}) click to toggle source
# File lib/ferret_adapter/local_index.rb, line 18
def search(query, options = {})
  @index.search(query, options).hits.collect { |hit, score| @index[hit.doc] }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.