Module: Collins::Api::Admin

Included in:
Collins::Api
Defined in:
lib/collins/api/admin.rb

Instance Method Summary collapse

Instance Method Details

#reindex_asset!(asset_or_tag) ⇒ Object

Reindex a single asset in Solr

Note that this will trigger a reindex of this asset and could cause extra load on Solr

asset you want to reindex

Parameters:

  • asset_or_tag (String, Collins::Asset)

    The asset or asset tag of the



30
31
32
33
34
35
36
# File 'lib/collins/api/admin.rb', line 30

def reindex_asset! asset_or_tag
  asset = get_asset_or_tag asset_or_tag
  http_get("/api/admin/solr/asset/#{asset.tag}") do |response|
    parse_response response, :expects => 200
  end

end

#repopulate_solr!(wait_for_completion = true) ⇒ Object

Trigger a full reindex of Solr

Note that this will trigger a full reindex of the assets and could cause extra load on Solr

Parameters:

  • wait_for_completion (Boolean) (defaults to: true)

    Execute the reindexing synchronously



13
14
15
16
17
18
19
20
21
# File 'lib/collins/api/admin.rb', line 13

def repopulate_solr! wait_for_completion = true
  parameters = {
    :waitForCompletion => wait_for_completion
  }
  http_get("/api/admin/solr", parameters) do |response|
    parse_response response, :expects => 200
  end

end