Class: Fiona7::CustomVerityAccessor

Inherits:
RailsConnector::SES::VerityAccessor
  • Object
show all
Defined in:
lib/fiona7/custom_verity_accessor.rb

Instance Method Summary collapse

Constructor Details

#initialize(query, options = {}) ⇒ CustomVerityAccessor

– Options: see VeritySearchRequest ++



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fiona7/custom_verity_accessor.rb', line 13

def initialize(query, options = {})
  @query = query
  @options = {
    :host => 'localhost',
    :port => 3011,
    :offset => 0,
    :limit => 10,
    :min_relevance => 50,
    :max_docs => 'unlimited',
    :parser => 'simple',
    :sort_order => [["score", "desc"], ["name", "asc"]],
    :collections => ['cm-contents'],
    :base_query => nil
  }.merge(options)
  @options[:collections] = Array(options[:collection]).flatten if options.has_key?(:collection)
end

Instance Method Details

#searchObject

Queries the SES and returns a SearchResult.

Exceptions:

  • SearchError - SES reported an error.



35
36
37
# File 'lib/fiona7/custom_verity_accessor.rb', line 35

def search
  parse_response_payload(send_to_ses(build_request_payload))
end