Module: Rummageable

Extended by:
Rummageable
Included in:
Rummageable
Defined in:
lib/rummageable.rb,
lib/rummageable/fake.rb,
lib/rummageable/version.rb,
lib/rummageable/implementation.rb

Defined Under Namespace

Classes: Fake, Implementation

Constant Summary collapse

InvalidDocument =
Class.new(RuntimeError)
CHUNK_SIZE =
20
VALID_KEYS =
[
%w[title],
%w[description],
%w[format],
%w[section],
%w[subsection],
%w[link],
%w[indexable_content],
%w[boost_phrases],
%w[additional_links title],
%w[additional_links link],
%w[additional_links link_order]
VERSION =
"0.3.0"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#implementationObject



29
30
31
# File 'lib/rummageable.rb', line 29

def implementation
  @implementation ||= Implementation.new
end

#path_prefixObject



24
25
26
# File 'lib/rummageable.rb', line 24

def path_prefix
  @path_prefix || ""
end

#rummager_hostObject



19
20
21
# File 'lib/rummageable.rb', line 19

def rummager_host
  @rummager_host || Plek.current.find(rummager_service_name)
end

#rummager_service_nameObject



14
15
16
# File 'lib/rummageable.rb', line 14

def rummager_service_name
  @rummager_service_name || "search"
end

Instance Method Details

#amend(link, amendments) ⇒ Object



44
45
46
# File 'lib/rummageable.rb', line 44

def amend(link, amendments)
  implementation.amend(link, amendments)
end

#commitObject



48
49
50
# File 'lib/rummageable.rb', line 48

def commit
  implementation.commit
end

#delete(link) ⇒ Object



40
41
42
# File 'lib/rummageable.rb', line 40

def delete(link)
  implementation.delete(link)
end

#index(documents) ⇒ Object

documents must be either a hash (for one document) or an array of hashes (for multiple documents)



36
37
38
# File 'lib/rummageable.rb', line 36

def index(documents)
  implementation.index(documents)
end

#validate_structure(hash, parents = []) ⇒ Object



66
67
68
# File 'lib/rummageable.rb', line 66

def validate_structure(hash, parents=[])
  implementation.validate_structure(hash, parents)
end