Skip to main content

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

TODO

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/

Metadata

Release files for invenio-global-search 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for invenio-global-search 0.8.0
File Size Uploaded Provenance Actions
invenio_global_search-0.8.0.tar.gz 9.9 kB Without provenance Details for invenio_global_search-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for invenio-global-search 0.8.0
File Interpreter ABI Platform Actions
invenio_global_search-0.8.0-py3-none-any.whl Python 3 none any Details for invenio_global_search-0.8.0-py3-none-any.whl

Total release size: 22.9 kB

Release files / invenio_global_search-0.8.0.tar.gz

Download URL invenio_global_search-0.8.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ef3e488cd31deeea2875af89d0ecd4287a85c5b804aa898c8336a6949d0305c3
BLAKE2b-256 checksum
How to use checksums
969061ddf574cd4b7dc5ed9deb2ce82b3aa4dfd2af9aed43acdaf37aa2a370e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / invenio_global_search-0.8.0-py3-none-any.whl

Download URL invenio_global_search-0.8.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85b04a9dba927dd3f09bdba4838b6243928f15fa8041c1f64e2c59f9907580f3
BLAKE2b-256 checksum
How to use checksums
138fd04c1427e6a9602bb78da50cb64ad350516438b9a4cc038266555dab0eb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for invenio-global-search 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page