class Exlibris::Primo::Search
Search
Primo
using Exlibris::Primo::Search
search = Search.new.base_url!("http://primo.library.edu"). add_query_term("Digital divide", "any", "contains") search.records #=> Array of Primo records search.facets #=> Array of Primo facets search.size #=> Total number of records in the search
There are a several configuration setting for the search
search = Search.new.base_url!("http://primo.library.edu").institution!("PRIMO"). enable_did_u_mean.on_campus.page_size!(20).start_index!(21).add_sort_by("stitle") add_query_term("Digital divide", "any", "contains") search.records #=> Array of Primo records search.facets #=> Array of Primo facets search.size #=> Total number of records in the search
Public Instance Methods
did_u_mean()
click to toggle source
Returns “Did U Mean” suggestion for the search.
# File lib/exlibris/primo/search.rb, line 62 def did_u_mean @did_u_mean ||= search.did_u_mean end
facets()
click to toggle source
Returns the array of Facets from the search.
# File lib/exlibris/primo/search.rb, line 48 def facets @facets ||= search.facets end
records()
click to toggle source
Returns the array of Records from the search.
# File lib/exlibris/primo/search.rb, line 41 def records @records ||= search.records end
search()
click to toggle source
Returns the Response from the search. Not really intended for public consumption.
# File lib/exlibris/primo/search.rb, line 33 def search request.write_attributes request_attributes @search ||= request.call end
size()
click to toggle source
Returns the total number of records from the search
# File lib/exlibris/primo/search.rb, line 55 def size @size ||= search.size end
Private Instance Methods
full_view_request()
click to toggle source
# File lib/exlibris/primo/search.rb, line 66 def full_view_request @full_view_request ||= Exlibris::Primo::WebService::Request::FullView.new record_request_attributes end
request()
click to toggle source
# File lib/exlibris/primo/search.rb, line 76 def request @request ||= (record_id) ? full_view_request : search_request end
search_request()
click to toggle source
# File lib/exlibris/primo/search.rb, line 71 def search_request @search_request ||= Exlibris::Primo::WebService::Request::Search.new end