Skip to content

Commit

Permalink
PP65: Opensearch migrations (#1268)
Browse files Browse the repository at this point in the history
* Initial migration API for Opensearch

This creates the definitions for schemas, and an API for
performing upgrades.

Affects: https://ebce-lyrasis.atlassian.net/browse/PP-37

* Add tests for search document types

* Implement mappings updates in populate_index()

* Implement bulk search document uploads.

* Adjust the interface so that search documents are created lazily.

* Adjust the API to allow for separate migration and population.

* Set index for search documents inside search service.

* Properly clean up indexes, as this was affecting test stability.

* Ensure that search documents must be written to aliases.

* Always specify the alias pointer for a search query

* Updated all Keyword type fields as filterable_strings

* Search index removal and repopulation via search_index_refresh

* SearchService object is now base name dependent

Since we have no use case of different base names in a single CM

* Search version is an implicit class variable now

It is not passed through the init, but should be part of the class definition

* Removed the burden of migration initialization from ExternalSearchIndex

Since instance_initialization does the same job, we depend on it to run before hand
Added test cases specifically for these scenarios

---------

Co-authored-by: Rishi Diwan <[email protected]>
  • Loading branch information
io7m and RishiDiwanTT authored Sep 21, 2023
1 parent 6953b8d commit 64afa28
Show file tree
Hide file tree
Showing 47 changed files with 3,389 additions and 1,780 deletions.
7 changes: 6 additions & 1 deletion api/admin/controller/custom_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ def _create_or_update_list(
if membership_change:
# We need to update the search index entries for works that caused a membership change,
# so the upstream counts can be calculated correctly.
self.search_engine.bulk_update(works_to_update_in_search)
documents = self.search_engine.create_search_documents_from_works(
works_to_update_in_search
)
index = self.search_engine.start_updating_search_documents()
index.add_documents(documents)
index.finish()

# If this list was used to populate any lanes, those lanes need to have their counts updated.
for lane in Lane.affected_by_customlist(list):
Expand Down
1 change: 0 additions & 1 deletion core/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ def operation(self):
def run(self):
start = utc_now()
result = self.run_once_and_update_timestamp()

result = result or CoverageProviderProgress()
self.finalize_timestampdata(result, start=start)
return result
Expand Down
Loading

0 comments on commit 64afa28

Please sign in to comment.