Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Solr URL in SystemStats module to be overridden
- Loading branch information
Showing
1 changed file
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,8 +98,12 @@ def query_service | |
@query_service ||= Sufia::QueryService.new | ||
end | ||
|
||
def terms_component_base_path | ||
"#{ActiveFedora.solr_config[:url]}/terms" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cbeer
Contributor
|
||
end | ||
|
||
def top_data(key, limit) | ||
query_url = "#{ActiveFedora.solr_config[:url]}/terms?terms.fl=#{key}&terms.sort=count&terms.limit=#{limit}&wt=json&omitHeader=true" | ||
query_url = "#{terms_component_base_path}?terms.fl=#{key}&terms.sort=count&terms.limit=#{limit}&wt=json&omitHeader=true" | ||
# Parse JSON response (looks like {"terms":{"depositor_tesim":["mjg36",3]}} for depositor) | ||
json = open(query_url).read | ||
unless json | ||
|
I suggest we should dig into
ActiveFedora::SolrService.instance
, instead of grabbing the configuration directly.