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 committed Sep 9, 2024
1 parent 56893c6 commit df0190d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions invenio_app_rdm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,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 @@ -155,6 +156,7 @@
from invenio_vocabularies.contrib.subjects.datastreams import (
VOCABULARIES_DATASTREAM_WRITERS as SUBJECTS_WRITERS,
)
from werkzeug.local import LocalProxy

from .theme.views import notification_settings
from .users.schemas import NotificationsUserSchema, UserPreferencesNotificationsSchema
Expand Down Expand Up @@ -651,7 +653,10 @@ 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 @@ -694,7 +699,9 @@ def files_rest_permission_factory(obj, action):
# ===============
# See https://invenio-indexer.readthedocs.io/en/latest/configuration.html

INDEXER_DEFAULT_INDEX = "rdmrecords-records-record-v7.0.0"
# We want that indexers are always explicit about the index they are indexing to.
# NOTE: Can be removed when https://github.com/inveniosoftware/invenio-indexer/pull/158 is merged and released.
INDEXER_DEFAULT_INDEX = None
"""Default index to use if no schema is defined."""

# Invenio-Base
Expand Down

0 comments on commit df0190d

Please sign in to comment.