def METHOD_NAME():
    pages = []
    for lang in kw["translations"]:
        for post in posts:
            # Don't index drafts (Issue #387)
            if post.is_draft or post.is_private or post.publish_later:
                continue
            text = post.text(lang, strip_html=True)
            text = text.replace('^', '')
            data = {}
            data["title"] = post.title(lang)
            data["text"] = text
            data["tags"] = ",".join(post.tags)
            data["url"] = post.permalink(lang, absolute=True)
            pages.append(data)
    output = json.dumps({"pages": pages}, indent=2)
    output = 'var tipuesearch = ' + output + ';'
    makedirs(os.path.dirname(dst_path))
    with codecs.open(dst_path, "wb+", "utf8") as fd:
        fd.write(output)