Dear Alexander,
On 12/07/2012 08:38 AM, Alexander Wagner wrote:
I would like to add an external collection to invenio that can be
searched along side with invenios internal stuff. For the time being
nothing fancy, just passing on the query to the external db retrieving
the results, display them like local results.
As far as I understand it a hosted collection is my friend in this
scenario. Right?
Correct. Actually, in its simplest form you would only need to set up an
External Collection and use the "External search [checked]" setting,
however, setting up a Hosted Collection will provide you with a few more
features.
This external collection is a bibliographic collection (no fulltexts)
based on a Solr instance serving also a vufind engine. How difficult
would it be to just reuse this as external collection in Invenio? Is
there some how to, if so, where?
There is some related documentation here:
http://invenio-demo.cern.ch/help/admin/websearch-admin-guide#4
In order to use hosted collections you need to have a /searcher/ and
/parser/ implemented, in /websearch_external_collections_searcher.py/
and /websearch_external_collections_parser.py/ respectively, for the
specific external collection you wish to use. There is already a
/searcher/ and /parser/ implemented for Invenio (/InvenioSearchEngine/
and /InvenioXMLExternalCollectionResultsParser/). The /configuration
file/ that brings all this together is:
/websearch_external_collections_config.py/. You will have to define your
hosted collection there, following the documentation and the examples.
_Example:_
'Atlantis Institute Articles':
{'engine': 'Invenio',
'base_url': 'http://invenio-demo.cern.ch/',
'parser_params':
{'host': 'invenio-demo.cern.ch',
'path': '',
'parser': InvenioXMLExternalCollectionResultsParser,
'fetch_format': 'xm',
'num_results_regex_str': r'<!--
Search-Engine-Total-Number-Of-Results: ([0-9,]+?) -->',
'nbrecs_regex_str': r'<!--
Search-Engine-Total-Number-Of-Results: ([0-9,]+?) -->',
'nbrecs_url':
'http://invenio-demo.cern.ch/search?cc=Articles&rg=0&of=xm'},
'search_url': 'http://invenio-demo.cern.ch/search?cc=Articles&p=',
'record_url': 'http://invenio-demo.cern.ch/record/',
'selected_by_default': True},
I quickly checked out some stuff from ADS but that is far beyond my
needs here. I'm not interesed in faceting and stuff. Just bare pass it
along and get the stuff for display, care about bibliographics only
external stuff even (almost at least) the same Marc fields.
It sounds like the current implementation of hosted collections should
do the trick for you.
Please see the documentation above, follow the steps and let me know if
you run into any issues.
Best regards,
Nikos