diff --git a/jans-linux-setup/jans_setup/setup_app/installers/rdbm.py b/jans-linux-setup/jans_setup/setup_app/installers/rdbm.py index 27ff2043979..0425d5c6eeb 100644 --- a/jans-linux-setup/jans_setup/setup_app/installers/rdbm.py +++ b/jans-linux-setup/jans_setup/setup_app/installers/rdbm.py @@ -222,6 +222,16 @@ def create_indexes(self): sql_indexes_fn = os.path.join(Config.static_rdbm_dir, Config.rdbm_type + '_index.json') sql_indexes = base.readJsonFile(sql_indexes_fn) + # read opendj indexes and add multivalued attributes to JSON indexing + opendj_index = base.readJsonFile(base.current_app.OpenDjInstaller.openDjIndexJson) + opendj_index_list = [ atribute['attribute'] for atribute in opendj_index ] + + for attribute in self.jans_attributes: + if attribute.get('multivalued'): + for attr_name in attribute['names']: + if attr_name in opendj_index_list and attr_name not in sql_indexes['__common__']['fields']: + sql_indexes['__common__']['fields'].append(attr_name) + if Config.rdbm_type == 'spanner': tables = self.dbUtils.spanner.get_tables() for tblCls in tables: @@ -237,7 +247,7 @@ def create_indexes(self): data_type = attr['type'] if data_type == 'ARRAY': - #TODO: How to index for ARRAY types in spanner? + # How to index for ARRAY types in spanner? pass elif attr_name in tbl_fields: @@ -340,7 +350,7 @@ def import_ldif(self): ldif_files.remove(Config.ldif_site) Config.pbar.progress(self.service_name, "Importing ldif files to {}".format(Config.rdbm_type), False) - if not Config.ldif_base in ldif_files: + if Config.ldif_base not in ldif_files: if Config.rdbm_type == 'mysql': force = BackendTypes.MYSQL elif Config.rdbm_type == 'pgsql':