plone / guillotina

Python AsyncIO data API to manage billions of resources
https://guillotina.readthedocs.io/en/latest/
Other
187 stars 50 forks source link

adding @update-catalog endpoint #1182

Open nilbacardit26 opened 1 year ago

nilbacardit26 commented 1 year ago

This goes in conjunction with this: https://github.com/plone/guillotina_elasticsearch/pull/105

With ES nowadays, if we want to index new fields using index_field the only way to update the mappings and settings of the index using the API of guillotina is to do a POST to @ catalog, which deletes the whole index, and creates it again. Then we need to reindex all the data calling POST @catalog-reindex. With this change, (regarding ES) when adding new index fields we can just call @update-catalog and delegate the logic (if necessary) to the catalog utility.

codecov-commenter commented 1 year ago

Codecov Report

Merging #1182 (1964657) into master (6ee373b) will decrease coverage by 0.1%. The diff coverage is 91.7%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/plone/guillotina/pull/1182/graphs/tree.svg?width=650&height=150&src=pr&token=MIUJDWnGXD&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=plone)](https://codecov.io/gh/plone/guillotina/pull/1182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=plone) ```diff @@ Coverage Diff @@ ## master #1182 +/- ## ======================================== - Coverage 94.7% 94.7% -0.0% ======================================== Files 358 358 Lines 30700 30712 +12 ======================================== + Hits 29069 29080 +11 - Misses 1631 1632 +1 ``` | [Impacted Files](https://codecov.io/gh/plone/guillotina/pull/1182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=plone) | Coverage Δ | | |---|---|---| | [guillotina/api/search.py](https://codecov.io/gh/plone/guillotina/pull/1182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=plone#diff-Z3VpbGxvdGluYS9hcGkvc2VhcmNoLnB5) | `90.7% <87.5%> (-0.4%)` | :arrow_down: | | [guillotina/catalog/catalog.py](https://codecov.io/gh/plone/guillotina/pull/1182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=plone#diff-Z3VpbGxvdGluYS9jYXRhbG9nL2NhdGFsb2cucHk=) | `87.0% <100.0%> (+0.2%)` | :arrow_up: | | [guillotina/interfaces/catalog.py](https://codecov.io/gh/plone/guillotina/pull/1182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=plone#diff-Z3VpbGxvdGluYS9pbnRlcmZhY2VzL2NhdGFsb2cucHk=) | `100.0% <100.0%> (ø)` | | | [guillotina/tests/test\_catalog.py](https://codecov.io/gh/plone/guillotina/pull/1182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=plone#diff-Z3VpbGxvdGluYS90ZXN0cy90ZXN0X2NhdGFsb2cucHk=) | `100.0% <100.0%> (ø)` | |