'Defers loading until needed.'

def setup(self):

    try:
        self.existing_mapping = self.conn.indices.get_mapping(index=self.index_name)
    except NotFoundError:
        pass
    except Exception:
        if (not self.silently_fail):
            raise
    unified_index = haystack.connections[self.connection_alias].get_unified_index()
    (self.content_field_name, field_mapping) = self.build_schema(unified_index.all_searchfields())
    current_mapping = {u'modelresult': {u'properties': field_mapping}}
    if (current_mapping != self.existing_mapping):
        try:
            self.conn.indices.create(index=self.index_name, body=self.DEFAULT_SETTINGS, ignore=400)
            self.conn.indices.put_mapping(index=self.index_name, doc_type=u'modelresult', body=current_mapping)
            self.existing_mapping = current_mapping
        except Exception:
            if (not self.silently_fail):
                raise
    self.setup_complete = True
