Module: RSolr

Extended by:
Char
Defined in:
lib/rsolr.rb

Defined Under Namespace

Modules: Char, Connection, Message, Pagination Classes: Client, RequestError

Constant Summary collapse

VERSION =
'0.10.1'

Class Method Summary collapse

Methods included from Char

escape

Class Method Details

.connect(*args) ⇒ Object

Http connection. Example:

RSolr.connect
RSolr.connect 'http://solr.web100.org'


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

def self.connect *args
  Client.new(Connection::NetHttp.new(*args))
end

.dirObject

returns path to this file directory



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

def self.dir
  File.expand_path(File.dirname(__FILE__))
end

.direct_connect(*args, &blk) ⇒ Object

DirectSolrConnection (jruby only). Example:

RSolr.direct_connect 'path/to/solr/distribution'
RSolr.direct_connect :dist_dir=>'path/to/solr/distribution', :home_dir=>'/path/to/solrhome'
RSolr.direct_connect opts do |rsolr|
  ###
end

Note: if a block is used, the client is yielded and the solr core will be closed for you. if a block is NOT used, the the client is returned and the core is NOT closed.



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

def self.direct_connect *args, &blk
  rsolr = Client.new(Connection::Direct.new(*args))
  block_given? ? (yield rsolr and rsolr.connection.close) : rsolr
end