invenio-global-search
Dublin Core data model for InvenioRDM
Tests
uv run ./run-tests.sh
Installation
This basic installation of this package:
uv pip install invenio-global-search
will not give access to any of its features. It is intended to be extended with the packages needed in a specific Invenio instance.
There are 3 packages handled by invenio-global-search:
rdm-records
lom (OER)
marc21 (Publications)
To install any of them or all:
uv pip install invenio-global-search[rdm]
This enables the rdm-records features.
uv pip install invenio-global-search[rdm, marc21, lom]
This enables all the features of the package.
Configuration
Add the following code blocks to the invenio.cfg file.
Components
If all packages mentioned above are installed, simply add:
from invenio_rdm_records.services.components import DefaultRecordsComponents
from invenio_global_search.components import (
LOMToGlobalSearchComponent,
Marc21ToGlobalSearchComponent,
RDMToGlobalSearchComponent,
)
from invenio_rdm_records.services.components import (
DefaultRecordsComponents as RDMDefaultRecordsComponents,
)
from invenio_records_lom.services.components import (
DefaultRecordsComponents as LOMDefaultRecordsComponents,
)
from invenio_records_marc21.services.components import (
DefaultRecordsComponents as Marc21DefaultRecordsComponents,
)
RDM_RECORDS_SERVICE_COMPONENTS = RDMDefaultRecordsComponents + [
RDMToGlobalSearchComponent
]
LOM_RECORDS_SERVICE_COMPONENTS = LOMDefaultRecordsComponents + [
LOMToGlobalSearchComponent
]
MARC21_RECORDS_SERVICE_COMPONENTS = Marc21DefaultRecordsComponents + [
Marc21ToGlobalSearchComponent
]
If there is a chance that one of them is not installed, this can be handled with try-except:
try:
from invenio_records_marc21.services.components import (
DefaultRecordsComponents as Marc21DefaultRecordsComponents,
)
except ImportError:
Marc21DefaultRecordsComponents = None
if Marc21DefaultRecordsComponents is not None:
MARC21_RECORDS_SERVICE_COMPONENTS = Marc21DefaultRecordsComponents + [
Marc21ToGlobalSearchComponent
]
else:
MARC21_RECORDS_SERVICE_COMPONENTS = [Marc21ToGlobalSearchComponent]
Search template
SEARCH_UI_SEARCH_TEMPLATE = "invenio_records_dublin_core/search/search.html"
from invenio_search_ui.views import blueprint
from flask import render_template
@blueprint.route("/records/search")
def records_search():
"""Search page ui."""
return render_template("invenio_app_rdm/records/search.html")
Schema
As mentioned for components, if all packages are installed, add:
GLOBAL_SEARCH_ORIGINAL_SCHEMAS = {
"lom": {
"schema": "lom",
"name_l10n": _("OER"),
},
"rdm": {
"schema": "rdm",
"name_l10n": _("Research Result"),
},
"marc21": {
"schema": "marc21",
"name_l10n": _("Publication"),
},
}
If one or more is missing, simply remove the entry for the respective package.
OpenAIRE Indexing
ListRecords & GetRecord features
An InvenioRDM repository can be harvested via the Open Archives Initiative Protocol for Metadata Harvesting (OAI-PMH). OAI-PMH is a widely used protocol for harvesting metadata and most popular repository software provide support for this protocol.
Because Global search needs to support multiple data models, the default OAISERVER_ features had to be overridden with custom function and classes that are based mostly on global-search index. This works also because global-search keeps track only of open-access records.
- Currently supported custom OAI Features:
ListRecords and GetRecord for
metadataPrefix = oai_dc -> records from all 3 data models are serialized
metadataPrefix = lom -> only OER records are serialized
metadataPrefix = marc21 -> only Publication records are serialized
Access these by searching for the endpoint /oai2d and adding params like ?verb=ListRecords. Examples:
https://yourinvenio.com/oai2d?verb=ListRecords&metadataPrefix=marc21
https://yourinvenio.com/oai2d?verb=GetRecord&identifier=oai:yourinvenio.com:46t12-eng12&metadataPrefix=marc21
Sets
TODO
Further documentation is available on https://invenio-global-search.readthedocs.io/
Changes
Version v0.6.0 (released 2026-10-02)
fix: catch serialization exception
fix: add created date to original
chore(linter): apply new ruff
Version v0.5.1 (released 2026-07-20)
fix: ty warning
fix(cli): read record before attempting global-search create
Version v0.5.0 (released 2026-06-12)
feat(cli): option to create/update only missing records
Version v0.4.3 (released 2026-05-21)
fix(oai): lom allows per defintion only lom
Version v0.4.2 (released 2026-05-18)
fix: code block for changes.rst
Version v0.4.1 (released 2026-05-18)
fix(docs): include word containing ‘_’ in code block
Version v0.4.0 (released 2026-05-18)
chore(docs): move to uv
fix(docs): keep only README.rst
chore(oai): add OAI docs
feat(oai): move not implemented sets fetcher to GS
tests: py 3.14
tests: add ruff check
fix: type errors
feat(oai): add necessary functions for OAISERVER_ overrides
Version v0.3.0 (release 2025-05-15)
refactor: heavy refactoring
tests: just python 3.12
chore: multiple small changes
docs: update README
dependencies: handle libraries just if installed
Version v0.2.5 (release 2025-01-24)
setup: only because of dev deps
setup: remove restrictions on dependencies
setup: update ruff/mypy configuration
refactor: remove None defaults
Version v0.2.4 (release 2024-06-13)
fix: catch validation error this ensures that rebuilding the database does not exit on the first error
setup: support only python3.12
Version v0.2.3 (release 2024-02-12)
fix: update changed lom api
Version v0.2.2 (release 2024-01-12)
fix: permission problem
Version v0.2.1 (release 2024-01-07)
fix: rebuild all databases
Version v0.2.0 (release 2023-11-23)
global: rename components
Version v0.1.0 (release 2023-11-10)
Metadata
Release files for invenio-global-search 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| invenio_global_search-0.6.0.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| invenio_global_search-0.6.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 34.8 kB
Release files / invenio_global_search-0.6.0.tar.gz
| Download URL | invenio_global_search-0.6.0.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
617e4c1b2d359052dac1336752c8975dee0babfd56254903fc33be668e780022
|
|
BLAKE2b-256 checksum How to use checksums |
10df28bd2cb9280dcad332412a78eeb7920a602497ec765a4ed021d5758aa155
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / invenio_global_search-0.6.0-py2.py3-none-any.whl
| Download URL | invenio_global_search-0.6.0-py2.py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
90ab8fac154e6070bcc15e0cf66abb2aa5766884091684bc116c150ea41a162e
|
|
BLAKE2b-256 checksum How to use checksums |
21ebddd5344e4d725cf20b95a791d7518457d49db9ebe98e13429ba0a719d785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|