Module: Spotlight::SolrDocument::AtomicUpdates

Defined in:
app/models/concerns/spotlight/solr_document/atomic_updates.rb

Overview

Solr indexing strategy using Solr’s Atomic Updates

Instance Method Summary collapse

Instance Method Details

#reindexObject



8
9
10
11
12
13
14
# File 'app/models/concerns/spotlight/solr_document/atomic_updates.rb', line 8

def reindex
  return unless write?

  data = hash_for_solr_update(to_solr)

  blacklight_solr.update params: { commitWithin: 500 }, data: data.to_json, headers: { 'Content-Type' => 'application/json' } unless data.empty?
end

#write?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/models/concerns/spotlight/solr_document/atomic_updates.rb', line 16

def write?
  Spotlight::Engine.config.writable_index
end