lib/qa/authorities/assign_fast/generic_authority.rb in qa-5.11.0 vs lib/qa/authorities/assign_fast/generic_authority.rb in qa-5.12.0
- old
+ new
@@ -44,10 +44,13 @@
def build_query_url(q)
escaped_query = clean_query_string q
index = AssignFast.index_for_authority(subauthority)
return_data = "#{index}%2Cidroot%2Cauth%2Ctype"
num_rows = 20 # max allowed by the API
- "http://fast.oclc.org/searchfast/fastsuggest?&query=#{escaped_query}&queryIndex=#{index}&queryReturn=#{return_data}&suggest=autoSubject&rows=#{num_rows}"
+
+ # sort=usage+desc is not documented by OCLC but seems necessary to get the sort
+ # we formerly got without specifying, that is most useful in our use case.
+ "http://fast.oclc.org/searchfast/fastsuggest?&query=#{escaped_query}&queryIndex=#{index}&queryReturn=#{return_data}&suggest=autoSubject&rows=#{num_rows}&sort=usage+desc"
end
private
# Removes characters from the query string that are not tolerated by the API