Skip to content

Commit

Permalink
search: allow the usage of INVENIO_SEARCH_INDEX_PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
psaiz committed Nov 29, 2023
1 parent ab9370b commit a300fe6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cernopendata/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
),
)

RECORDS_REST_ENDPOINTS['recid']['search_index'] = '_all'
RECORDS_REST_ENDPOINTS['recid']['search_index'] = 'records'

RECORDS_REST_ENDPOINTS['recid'].update({
# 'search_factory_imp': 'cernopendata.modules.records.search.query'
Expand Down Expand Up @@ -293,7 +293,7 @@
}

RECORDS_REST_SORT_OPTIONS = {
"_all": {
"records": {
'bestmatch': dict(
fields=['-_score'],
title='Best match',
Expand All @@ -319,15 +319,15 @@

# TODO: based on invenio-records-rest default config
RECORDS_REST_DEFAULT_SORT = dict(
_all=dict(
records=dict(
query='bestmatch',
noquery='mostrecent',
)
)
RECORDS_REST_FACETS_FILTER = True

RECORDS_REST_FACETS = {
'_all': {
'records': {
'aggs': dict(
type=dict(terms=dict(
field='type.primary',
Expand Down Expand Up @@ -612,9 +612,12 @@
#: Do not map any keywords.
SEARCH_ELASTIC_KEYWORD_MAPPING = {}

# This one can be used to have multiple instances on the same cluster
# SEARCH_INDEX_PREFIX = "opendata-dev-"

#: Configure the search page template.
SEARCH_UI_SEARCH_TEMPLATE = 'cernopendata_search_ui/search.html'
SEARCH_UI_SEARCH_INDEX = '_all'
SEARCH_UI_SEARCH_INDEX = 'records'
#: Override the React-SearchKit config generator to support range aggs.
SEARCH_UI_SEARCH_CONFIG_GEN = {
'invenio_records_rest': CODSearchAppInvenioRestConfigHelper,
Expand All @@ -623,7 +626,7 @@
# OAI-PMH
# =======
#: Default Elasticsearch index.
OAISERVER_RECORD_INDEX = '_all'
OAISERVER_RECORD_INDEX = 'records'
#: OAI ID prefix.
OAISERVER_ID_PREFIX = 'oai:opendata.cern.ch:recid/'

Expand Down

0 comments on commit a300fe6

Please sign in to comment.