Skip to content

Commit

Permalink
index: moving from templates to index_templates
Browse files Browse the repository at this point in the history
  • Loading branch information
psaiz committed Feb 28, 2024
1 parent f36dff6 commit 2e4c9c2
Show file tree
Hide file tree
Showing 16 changed files with 263 additions and 261 deletions.
129 changes: 0 additions & 129 deletions cernopendata/mappings/os-v2/records/docs-v1.0.0.json

This file was deleted.

87 changes: 0 additions & 87 deletions cernopendata/mappings/os-v2/records/glossary-term-v1.0.0.json

This file was deleted.

6 changes: 3 additions & 3 deletions cernopendata/modules/fixtures/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def records(skip_files, files, profile, mode):

indexer = RecordIndexer()
schema = current_app.extensions["invenio-jsonschemas"].path_to_url(
"records/record-v1.0.0.json"
"records/opendata-record-v1.0.0.json"
)
data = pkg_resources.resource_filename(
"cernopendata", "modules/fixtures/data/records"
Expand Down Expand Up @@ -282,7 +282,7 @@ def glossary(files, mode):
"""Load glossary term records."""
indexer = RecordIndexer()
schema = current_app.extensions["invenio-jsonschemas"].path_to_url(
"records/glossary-term-v1.0.0.json"
"records/opendata-opendata-glossary-term-v1.0.0.json"
)
data = pkg_resources.resource_filename("cernopendata", "modules/fixtures/data")

Expand Down Expand Up @@ -370,7 +370,7 @@ def docs(files, mode):

indexer = RecordIndexer()
schema = current_app.extensions["invenio-jsonschemas"].path_to_url(
"records/docs-v1.0.0.json"
"records/opendata-docs-v1.0.0.json"
)
data = pkg_resources.resource_filename("cernopendata", "modules/fixtures/data/docs")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of CERN Open Data Portal.
# Copyright (C) 2021 CERN.
# Copyright (C) 2024 CERN.
#
# CERN Open Data Portal is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
Expand Down
25 changes: 25 additions & 0 deletions cernopendata/modules/search/component_templates/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
#
# This file is part of CERN Open Data Portal.
# Copyright (C) 2016, 2024 CERN.
#
# CERN Open Data Portal is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# CERN Open Data Portal 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with CERN Open Data Portal; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

"""CERN Open Data Component templates."""
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of CERN Open Data Portal.
# Copyright (C) 2016, 2017 CERN.
# Copyright (C) 2024 CERN.
#
# CERN Open Data Portal is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
Expand All @@ -22,4 +22,4 @@
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

"""CERN Open Data Mappings."""
"""Pages for CERN Open Data Portal."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"template": {
"mappings": {
"properties": {
"$schema": {
"copy_to": "facet_schema",
"type": "text"
},
"date_created": {
"type": "keyword"
},
"date_published": {
"type": "date"
},
"experiment": {
"type": "keyword"
},
"facet_schema": {
"index": true,
"type": "text"
},
"recid": {
"type": "integer",
"null_value": 0
},
"title": {
"type": "text"
},
"type": {
"properties": {
"primary": {
"type": "keyword"
},
"secondary": {
"type": "keyword"
}
}
}
}
},
"settings": {
"number_of_replicas": 1
}
}

}

0 comments on commit 2e4c9c2

Please sign in to comment.