def METHOD_NAME(input, out):
    # first read in and prep the search data
    terms = _prep_search_terms(input)
    conn = es_connection
    application_rows = []
    for a in esprit.tasks.scroll(conn, ipt_prefix(models.Suggestion.__type__), q=APPS_NOT_ACCEPTED, page_size=1000, keepalive='5m'):
        application = models.Suggestion(_source=a)
        title = application.bibjson().title
        alt = application.bibjson().alternative_title
        titles = []
        if title is not None and title != "":
            titles.append(_normalise_title(title))
        if alt is not None and alt != "":
            titles.append(_normalise_title(alt))
        for variants in terms:
            for v in variants:
                if v in titles or len([t for t in titles if v in t]) > 0:
                    row = [variants[-1]] + _extract_report_row(application)
                    application_rows.append(row)
                    break
    journal_rows = []
    for j in esprit.tasks.scroll(conn, models.Journal.__type__, q=ALL_JOURNALS, page_size=1000, keepalive='5m'):
        journal = models.Journal(_source=j)
        title = journal.bibjson().title
        alt = journal.bibjson().alternative_title
        titles = []
        if title is not None and title != "":
            titles.append(_normalise_title(title))
        if alt is not None and alt != "":
            titles.append(_normalise_title(alt))
        for variants in terms:
            for v in variants:
                if v in titles or len([t for t in titles if v in t]) > 0:
                    row = [variants[-1]] + _extract_journal_row(journal)
                    application_rows.append(row)
                    break
    with open(out, "w", encoding="utf-8") as o:
        writer = csv.writer(o)
        writer.writerow([
            "Supplied Title",
            "Type",
            "ISSN(s)",
            "Date Created",
            "Last Updated",
            "Date Applied",
            "Status",
            "Most Recent Note",
            "Title Matched",
            "Alternative Title Matched",
            "Link"
        ])
        for row in application_rows:
            writer.writerow(row)
        for row in journal_rows:
            writer.writerow(row)