-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds kibana container to docker compose file. * Creates CLI command to index resources managed by `invenio-records-resources`. * Stores full name of user in index. * Uniformizes the storage of suggestions fields. * Moves autocomplete filter and analyzer in record template. * Removes old mapping for projects. * Adds a method `bulk_reindex` in record's service base class. * Creates a specific `RecordIdProvider` for project resource to specify the right `pid_type`. * Stores the `pid_type` in Record class to be able to retrieve it later. Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
- Loading branch information
Sébastien Délèze
committed
Mar 17, 2021
1 parent
3b5a84d
commit 3f679f8
Showing
16 changed files
with
226 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 0 additions & 161 deletions
161
sonar/modules/projects/mappings/v7/projects/project-v1.0.0.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Swiss Open Access Repository | ||
# Copyright (C) 2021 RERO | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Resources CLI commands.""" | ||
|
||
import click | ||
from flask.cli import with_appcontext | ||
from invenio_indexer.cli import abort_if_false | ||
|
||
from sonar.proxies import sonar | ||
|
||
|
||
@click.group() | ||
def resources(): | ||
"""Resources CLI commands.""" | ||
|
||
|
||
@resources.command('reindex') | ||
@click.argument('record-type') | ||
@click.option('--yes-i-know', | ||
is_flag=True, | ||
callback=abort_if_false, | ||
expose_value=False, | ||
prompt='Do you really want to reindex all records?') | ||
@with_appcontext | ||
def reindex(record_type): | ||
"""Reindex all records for the given type. | ||
Reindex all records managed by `invenio-records-resouces` for the given | ||
type. | ||
:param record_type: Record type. | ||
""" | ||
click.secho(f'Indexing records of type "{record_type}"') | ||
sonar.service(record_type).bulk_reindex() | ||
click.secho('Record indexed successfully!', fg='green') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.