Module: Olibrary::Search
- Included in:
- Client
- Defined in:
- lib/olibrary/client/search.rb
Instance Method Summary collapse
-
#search(search_params, limit = 10, offset = 0) ⇒ Object
Robust access to the Olibrary free-text search.
Instance Method Details
#search(search_params, limit = 10, offset = 0) ⇒ Object
Robust access to the Olibrary free-text search.
A simple search is converted to a cross field query. You can add multiple requirements to a single parameter by including a comma within the string. @example: search(“Science, Physics”) will find all books with both science AND physics as subjects)
Likewise you can combine multiple parameters to refine your results Possible search parameter keys include :q (cross-field query) :author :publisher :isbn :title :person :place :subject
27 28 29 30 |
# File 'lib/olibrary/client/search.rb', line 27 def search(search_params, limit = 10, offset = 0) processed_params = search_params.is_a?(String) ? { q: search_params } : search_params _search(processed_params, limit, offset) end |