def METHOD_NAME(searcher, prediction_fn, output_fn, qid2text_time, qid2reldocids, K=1000):
    f = open(prediction_fn, "w")
    outa = open(os.path.join(output_fn, "a.toks"), "w") # , encoding="utf-8"
    outb = open(os.path.join(output_fn, "b.toks"), "w") # , encoding="utf-8"
    outid = open(os.path.join(output_fn, "id.txt"), "w") # , encoding="utf-8"
    outsim = open(os.path.join(output_fn, "sim.txt"), "w") # , encoding="utf-8"
    outurl = open(os.path.join(output_fn, "url.txt"), "w", encoding="utf-8") # , encoding="utf-8"
    for qid in qid2text_time:
        a, t = qid2text_time[qid]
        hits = searcher.search(JString(a), K, t)
        for i in range(len(hits)):
            sim = hits[i].score
            docno = hits[i].docid
            label = 1 if qid in qid2reldocids and docno in qid2reldocids[qid] else 0
            b, url = parse_doc_from_index_tweet(hits[i].content)
            b = "".join(filter(lambda x: x in printable, b))
            f.write("{} Q0 {} {} {:.6f} Anserini\n".format(qid, docno, i+1, sim))
            outa.write("{}\n".format(a))
            outb.write("{}\n".format(b))
            outid.write("{} Q0 {} {} {:.6f} Anserini\n".format(qid, docno, i+1, sim))
            outsim.write("{}\n".format(label))
            outurl.write("{}\n".format(url))
    outa.close()
    outb.close()
    outid.close()
    outsim.close()
    outurl.close()
    f.close()