Skip to main content
https://github.com/tu-graz-library/invenio-global-search/workflows/CI/badge.svg https://img.shields.io/github/tag/tu-graz-library/invenio-global-search.svg https://img.shields.io/pypi/dm/invenio-global-search.svg https://img.shields.io/github/license/tu-graz-library/invenio-global-search.svg

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.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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

invenio_global_search-0.5.1.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

invenio_global_search-0.5.1-py2.py3-none-any.whl (15.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file invenio_global_search-0.5.1.tar.gz.

File metadata

  • Download URL: invenio_global_search-0.5.1.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for invenio_global_search-0.5.1.tar.gz
Algorithm Hash digest
SHA256 127d063d6e018e47f427430f1f02263fe84a619bd6cf53848e5d83827b73a475
MD5 ac42e98c41673debb75b780789c44686
BLAKE2b-256 530bec777ac418943248fdcef35d41e904d69fdcd36d6123b1b8d3762b854f74

See more details on using hashes here.

File details

Details for the file invenio_global_search-0.5.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for invenio_global_search-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a37e80119785cc2d3286d71ed00e80b42ee7e862aa126cc8167b4a001f15e48f
MD5 497363ec18e5e71eec05edeb12a0f563
BLAKE2b-256 8ef77b9bdc2d672cff28ae300229d3601186d35e08081d08af3baedb897cee1b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.3.0

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page