Skip to content

Commit

Permalink
percolator: use OAISERVER_RECORD_INDEX to determine percolator index
Browse files Browse the repository at this point in the history
* Instead of relying on the default `RecordIndexer` class to determine
  the percolator index, we reuse the `OAISERVER_RECORD_INDEX` config variable.
  • Loading branch information
slint committed Dec 16, 2024
1 parent 468822a commit 56d430a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions invenio_oaiserver/percolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))]
Expand Down

0 comments on commit 56d430a

Please sign in to comment.