From 65f0d1bcf7f2f815a23bc6a8ec22c8b115bd697b Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Thu, 12 Dec 2024 14:38:38 +0100 Subject: [PATCH] percolator: use `OAISERVER_RECORD_INDEX` to determine percolator index * Instead of relying on the default `RecordIndexer` class to determine the percolator index, we reuse the `OAISERVER_RECORD_INDEX` config variable. --- invenio_oaiserver/percolator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/invenio_oaiserver/percolator.py b/invenio_oaiserver/percolator.py index 86631c8..9cc044b 100644 --- a/invenio_oaiserver/percolator.py +++ b/invenio_oaiserver/percolator.py @@ -12,7 +12,6 @@ import json from flask import current_app -from invenio_indexer.api import RecordIndexer from invenio_search import current_search, current_search_client from invenio_search.engine import search from invenio_search.utils import build_index_name @@ -166,8 +165,8 @@ def sets_search_all(records): if not records: return [] - # TODO: records should all have the same index. maybe add index as parameter? - record_index = RecordIndexer()._record_to_index(records[0]) + record_index = str(current_app.config["OAISERVER_RECORD_INDEX"]) + # TODO: We shouldn't have to always create the percolator mapping here _create_percolator_mapping(record_index) percolator_index = _build_percolator_index_name(record_index) record_sets = [[] for _ in range(len(records))]