Twig

craft.holmes puts the same read-only questions the control panel asks into your templates — handy for a diagnostics page, or for telling an author that the thing they just saved cannot be found.

Rows for an element

{% set rows = craft.holmes.rows(entry.id, currentSite.id) %}

{% for row in rows %}
    {{ row.getLabel() }}: {{ row.getTrimmedKeywords() }}
{% endfor %}

getLabel() gives the human name of the row — Title, or the field’s name. getTrimmedKeywords() strips the padding spaces Craft stores around the value.

Is this indexed at all?

{% if not craft.holmes.isIndexed(entry.id) %}
    <p>This entry can't be found by search.</p>
{% endif %}

Searching

{% set result = craft.holmes.search('baker street') %}

{{ result.totalRows }} rows, {{ result.elementCount }} elements

The result carries everything the search console shows — the parsed terms and their strategies, the matching rows and the scores — so you can build your own view of it if you want one.

Comparing an element

{% set differences = craft.holmes.compare(entry) %}

{% if differences is empty %}
    <p>The index is exactly right for this entry.</p>
{% else %}
    <p>{{ differences|length }} row(s) disagree with the live content.</p>
{% endif %}

An empty result means the index matches. Each difference is keyed by attribute|fieldIdtitle|0, field|17 — and carries a status plus the missing and extra words.

Everything else

CallReturns
craft.holmes.rows(id, siteId)Every index row for an element
craft.holmes.isIndexed(id)Whether it has any rows at all
craft.holmes.stats()Index size and composition
craft.holmes.coverage()How much of each element type is indexed
craft.holmes.search(query)A full search console result
craft.holmes.compare(element)Stored keywords against recomputed ones
craft.holmes.queue()Pending and reserved deferred-index rows
craft.holmes.latestAudit()The most recent finished audit
craft.holmes.highlight(text, terms)Search terms marked up in a string

A word of caution

compare() loads and recomputes an element, which is the expensive call in this list. It is fine on a diagnostics page behind a login; it is not something to put in a loop over a search results page.

None of these check permissions — they are template functions, and your template decides who sees them. If you expose index internals on a public page, gate it yourself.