Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search: The component_templates do not need to specify the SEARCH_IND… #228

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

psaiz
Copy link
Contributor

@psaiz psaiz commented Mar 1, 2024

Currently, all templates need to define the SEARCH_INDEX_PREFIX. Otherwise, uploading the template fails. This makes sense for index_templates, and not for component templates.
This patch makes sure that the components are not required to specify the prefix.

@psaiz psaiz requested a review from slint March 1, 2024 14:12
@psaiz psaiz marked this pull request as draft March 1, 2024 14:12
@psaiz
Copy link
Contributor Author

psaiz commented Mar 4, 2024

This is how the execution looks like:

There is no need for 'Putting templates' (no items specified)
Putting component templates...
  [------------------------------------]    0%/opt/invenio/var/instance/python/lib/python3.9/site-packages/invenio_search/ext.py:467: UserWarning: You are using the prefix `opendata-dev-v007-`, but the template `/code/cernopendata/modules/search/component_templates/os-v2/opendata-docs-v1.0.0.json` does not contain the pattern `__SEARCH_INDEX_PREFIX__`.
  warnings.warn(message)

/code/cernopendata/modules/search/component_templates/os-v2/opendata-docs-v1.0.0.json  [#########---------------------------]   25%/opt/invenio/var/instance/python/lib/python3.9/site-packages/invenio_search/ext.py:467: UserWarning: You are using the prefix `opendata-dev-v007-`, but the template `/code/cernopendata/modules/search/component_templates/os-v2/opendata-glossary-term-v1.0.0.json` does not contain the pattern `__SEARCH_INDEX_PREFIX__`.
  warnings.warn(message)

/code/cernopendata/modules/search/component_templates/os-v2/opendata-glossary-term-v1.0.0.json  [##################------------------]   50%/opt/invenio/var/instance/python/lib/python3.9/site-packages/invenio_search/ext.py:467: UserWarning: You are using the prefix `opendata-dev-v007-`, but the template `/code/cernopendata/modules/search/component_templates/os-v2/opendata-record-v1.0.0.json` does not contain the pattern `__SEARCH_INDEX_PREFIX__`.
  warnings.warn(message)

/code/cernopendata/modules/search/component_templates/os-v2/opendata-record-v1.0.0.json  [###########################---------]   75%       /opt/invenio/var/instance/python/lib/python3.9/site-packages/invenio_search/ext.py:467: UserWarning: You are using the prefix `opendata-dev-v007-`, but the template `/code/cernopendata/modules/search/component_templates/os-v2/opendata-common-v1.0.0.json` does not contain the pattern `__SEARCH_INDEX_PREFIX__`.
  warnings.warn(message)

/code/cernopendata/modules/search/component_templates/os-v2/opendata-common-v1.0.0.json  [####################################]  100%       
Putting index templates...
/code/cernopendata/modules/search/index_templates/os-v2/opendata-glossary-term-v1.0.0.json  [####################################]  100%
There is no need for 'Creating indexes' (no items specified)

@psaiz psaiz marked this pull request as ready for review March 4, 2024 08:50
Copy link
Member

@slint slint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, two tiny nits, but otherwise we can merge and relase.

invenio_search/ext.py Outdated Show resolved Hide resolved
invenio_search/ext.py Outdated Show resolved Hide resolved
@slint slint merged commit 10f4cd7 into inveniosoftware:master Mar 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants