Celsius::Primo
Celsius::Primo aims to provide an adapter layer above various Primo apis. The goal is, to use primo in a way similar to Elasticsearch by translating Elasticsearch requests to Primo requests and vice versa.
Usage
require "celsius/primo"
adapter = Celsius::Primo::Adapter.new({
institution: "PAD",
languages: [
"ger",
"eng"
],
locations:[
{
type: "local",
value: "scope:(PAD_ALEPH)"
}
],
soap_api_options: {
searcher_url: "http://primo.kobv.de/primo_library/libweb/webservices/services/searcher"
}
})
adapter.search({
# Elasticsearch style search request
from: 0,
size: 20,
query: {
bool: {
must: [
query_string: {
default_operator: "AND",
fields: ["_all"],
query: "linux"
}
]
}
}
}) # => Elasticsearch style response
Contributing
- Fork it ( https://github.com/[my-github-username]/celsius-primo/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request