def find_models_and_delete_search_index(self, model, force, exec_models, check_only):
ins = model(fake_context)<EOL>fields = self.get_schema_fields(ins._collect_index_fields())<EOL>new_schema = self.compile_schema(fields)<EOL>bucket_name = model._get_bucket_name()<EOL>bucket_type = client.bucket_type(settings.DEFAULT_BUCKET_TYPE)<EOL>bucket = bucket_type.bucket(bucket_name)<EOL>index_name = "<STR_LIT>" % (settings.DEFAULT_BUCKET_TYPE, bucket_name)<EOL>if not force:<EOL><INDENT>try:<EOL><INDENT>schema = get_schema_from_solr(index_name)<EOL>if schema == new_schema:<EOL><INDENT>print("<STR_LIT>" % index_name)<EOL>return<EOL><DEDENT>elif check_only and schema != new_schema:<EOL><INDENT>print("<STR_LIT>" % index_name)<EOL>return<EOL><DEDENT><DEDENT>except:<EOL><INDENT>import traceback<EOL>traceback.print_exc()<EOL><DEDENT><DEDENT>bucket.set_property('<STR_LIT>', '<STR_LIT>')<EOL>try:<EOL><INDENT>client.delete_search_index(index_name)<EOL><DEDENT>except RiakError as e:<EOL><INDENT>if '<STR_LIT>' != e.value:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>wait_for_schema_deletion(index_name)<EOL>exec_models.append(model)<EOL>
Finds models to execute and these models' exist search indexes are deleted.
For other operations, necessary models are gathered to list(exec_models)

Args:
    model: model to execute
    force(bool): True or False if True, all given models are executed.
    exec_models(list): if not force, models to execute are gathered to list.
    If there is not necessity to migrate operation model doesn't put to exec list.
    check_only: do not migrate, only report migration is needed or not if True

Returns: