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
-
.connect(*args) ⇒ Object
Http connection.
-
.dir ⇒ Object
returns path to this file directory.
-
.direct_connect(*args, &blk) ⇒ Object
DirectSolrConnection (jruby only).
Methods included from Char
Class Method Details
.connect(*args) ⇒ Object
26 27 28 |
# File 'lib/rsolr.rb', line 26 def self.connect *args Client.new(Connection::NetHttp.new(*args)) end |
.dir ⇒ Object
returns path to this file directory
19 20 21 |
# File 'lib/rsolr.rb', line 19 def self.dir File.(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 |