class CDMDEXER::DefaultSolr
Commnicate with Solr: add / delete stuff
Attributes
client[R]
url[R]
Public Class Methods
new(url: 'http://localhost:8983/solr/core-here', client: RSolr)
click to toggle source
# File lib/cdmdexer/default_solr.rb, line 7 def initialize(url: 'http://localhost:8983/solr/core-here', client: RSolr) @url = url @client = client end
Public Instance Methods
add(records)
click to toggle source
# File lib/cdmdexer/default_solr.rb, line 27 def add(records) connection.add records end
connection()
click to toggle source
# File lib/cdmdexer/default_solr.rb, line 23 def connection @connection ||= client.connect url: url end
delete(ids)
click to toggle source
# File lib/cdmdexer/default_solr.rb, line 31 def delete(ids) connection.delete_by_id ids end
ids(start: 0)
click to toggle source
# File lib/cdmdexer/default_solr.rb, line 12 def ids(start: 0) connection.get('select', :params => { :q => '*:*', :defType => 'edismax', :fl => '', :rows => 10, :start => start } ) end