<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
    {{{handlebarsHelpers}}}
    var tpl = Handlebars.template({{{precompiledSearchResultsTemplate}}});
    var $search = document.getElementById('search');

    if ('searchInstance' in window && $search !== null) { searchInstance.search(tpl, $search); }
});
</script>
<details class="search-help">
    <summary class="search-help__summary">How does the search work?</summary>
    <p class="search-help__paragraph paragraph">
        Matching is case-insensitive and fuzzy, so <code>fooo</code> also finds <code>foo</code>.
        You can combine terms with <code>+</code> (AND) and <code>-</code> (NOT):
    </p>
    <table class="search-help__table">
        <thead>
            <tr><th>Query</th><th>Meaning</th><th>Example result</th></tr>
        </thead>
        <tbody>
            <tr>
                <td><code>foo</code></td>
                <td>all documents containing "foo"</td>
                <td>every page and post with "foo"</td>
            </tr>
            <tr>
                <td><code>foo bar</code></td>
                <td>OR: all documents containing "foo" or "bar"</td>
                <td>union of both result sets</td>
            </tr>
            <tr>
                <td><code>foo +bar</code></td>
                <td>AND: only documents containing "foo" and "bar"</td>
                <td>documents with both terms</td>
            </tr>
            <tr>
                <td><code>+foo</code></td>
                <td>same as <code>foo</code> (a leading + on a single term is equivalent)</td>
                <td>every page and post with "foo"</td>
            </tr>
            <tr>
                <td><code>+foo +bar</code></td>
                <td>only documents containing both "foo" and "bar"</td>
                <td>intersection of both terms</td>
            </tr>
            <tr>
                <td><code>foo -bar</code></td>
                <td>documents containing "foo" but not "bar"</td>
                <td>"foo" results without "bar" documents</td>
            </tr>
            <tr>
                <td><code>-foo</code></td>
                <td>all documents that do NOT contain "foo"</td>
                <td>every page and post without "foo"</td>
            </tr>
            <tr>
                <td><code>"foo"</code></td>
                <td>literal match only — disables fuzzy matching</td>
                <td>only documents with the exact term "foo"</td>
            </tr>
        </tbody>
    </table>
    <p class="search-help__paragraph paragraph">
        Results are sorted by number of hits. Phrases like <code>"foo bar"</code> are not supported.
        Clicking a result marks the search terms in the target page so you can highlight them with CSS
        (e.g. <code>span.search-mark</code>).
    </p>
</details>
<div class="search-results" id="search"></div>
