Class: LucidWorks::Server

Inherits:
Object
  • Object
show all
Includes:
Associations
Defined in:
lib/lucid_works/server.rb

Overview

The LucidWorks::Server class is the starting point for access to a LucidWorks Solr search server.

Constant Summary collapse

DEFAULT_REST_API_PATH =
"/api"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_uri, options = {}) ⇒ Server

Returns a new instance of Server.



16
17
18
19
# File 'lib/lucid_works/server.rb', line 16

def initialize(server_uri, options = {})
  @host = server_uri
  @path = options.delete(:path) || DEFAULT_REST_API_PATH
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



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

def host
  @host
end

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#crawler(name) ⇒ Object



26
27
28
# File 'lib/lucid_works/server.rb', line 26

def crawler(name)
  crawlers.detect { |c| c.name == name }
end

#logs_urlObject

Location where raw log files may be retrieved



35
36
37
# File 'lib/lucid_works/server.rb', line 35

def logs_url
  "#{host}/logs/"
end

#solr_uriObject



30
31
32
# File 'lib/lucid_works/server.rb', line 30

def solr_uri
  "#{host}/solr/"
end

#uriObject Also known as: rest_api_uri



21
22
23
# File 'lib/lucid_works/server.rb', line 21

def uri
  @host + @path
end