Skip to content

Commit

Permalink
config: make OAI-PMH record index dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
slint authored and max-moser committed Jan 14, 2025
1 parent 4e57b52 commit 1522187
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions invenio_app_rdm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
UserAccessRequestDeclineNotificationBuilder,
UserAccessRequestSubmitNotificationBuilder,
)
from invenio_rdm_records.proxies import current_rdm_records_service
from invenio_rdm_records.requests.entity_resolvers import (
EmailResolver,
RDMRecordServiceResultResolver,
Expand Down Expand Up @@ -116,6 +117,7 @@
from invenio_vocabularies.contrib.names.datastreams import (
VOCABULARIES_DATASTREAM_WRITERS as NAMES_WRITERS,
)
from werkzeug.local import LocalProxy

from .theme.views import notification_settings
from .users.schemas import NotificationsUserSchema, UserPreferencesNotificationsSchema
Expand Down Expand Up @@ -612,7 +614,9 @@ def files_rest_permission_factory(obj, action):
OAISERVER_RECORD_SETS_FETCHER = "invenio_oaiserver.percolator:find_sets_for_record"
"""Record's OAI sets function."""

OAISERVER_RECORD_INDEX = "rdmrecords-records"
OAISERVER_RECORD_INDEX = LocalProxy(
lambda: current_rdm_records_service.record_cls.index._name
)
"""Specify a search index with records that should be exposed via OAI-PMH."""

OAISERVER_GETRECORD_FETCHER = "invenio_rdm_records.oai:getrecord_fetcher"
Expand Down Expand Up @@ -655,7 +659,9 @@ def files_rest_permission_factory(obj, action):
# ===============
# See https://invenio-indexer.readthedocs.io/en/latest/configuration.html

INDEXER_DEFAULT_INDEX = "rdmrecords-records-record-v6.0.0"
INDEXER_DEFAULT_INDEX = LocalProxy(
lambda: current_rdm_records_service.record_cls.index._name
)
"""Default index to use if no schema is defined."""

# Invenio-Base
Expand Down

0 comments on commit 1522187

Please sign in to comment.