@@ -510,14 +510,14 @@ def name_to_es_name(name):
510510def create_index (index_name , mapping_body , aliases ):
511511 """Create index in opensearch, add under given aliases."""
512512 prefixed_index = prefix_index (index_name )
513- if not es .indices .exists (prefixed_index ):
513+ if not es .indices .exists (index = prefixed_index ):
514514 current_search .mappings [prefixed_index ] = {} # invenio search needs it
515515
516516 es .indices .create (index = prefixed_index , body = mapping_body , ignore = False )
517517
518518 for alias in aliases :
519519 es .indices .update_aliases (
520- {'actions' : [{'add' : {'index' : prefixed_index , 'alias' : prefix_index (alias )}}]}
520+ body = {'actions' : [{'add' : {'index' : prefixed_index , 'alias' : prefix_index (alias )}}]}
521521 )
522522
523523
@@ -564,8 +564,8 @@ def before_delete_schema(mapper, connect, schema):
564564 prefix_index (schema .record_index ),
565565 prefix_index (schema .deposit_index )
566566 ):
567- if es .indices .exists (index ):
568- es .indices .delete (index )
567+ if es .indices .exists (index = index ):
568+ es .indices .delete (index = index )
569569
570570 # invenio search needs it
571571 mappings_imp = current_app .config .get ('SEARCH_GET_MAPPINGS_IMP' )
0 commit comments