format_config macro in views.py
The configuration of the endpoint URL /api/records and the facets/sort options is now taken from the RECORDS_REST_ENDPOINTS config, search_index field. See Jinja macro:
@blueprint.app_template_filter("format_config")
def format_config(config, endpoint_name):
"""Create config JSON dump for Invenio-Search-JS with React-SearchKit."""
search_index = (
config.get("RECORDS_REST_ENDPOINTS", {})
.get(endpoint_name, {})
.get("search_index", "records")
)
facets = dict(aggs=dict(type=dict(terms=dict(field="type"))))
The issue is that in the records-rest, the search_index field might not be defined (automatically retrieved from the search class).
The second issue is that facets works only with terms, the config parsing should changed or enhanced.