The searchindex object is used within the searchindex tag, and provides access to the results of a query.

{% searchindex query: 'support', page:, page_size: 10 %}
{% if searchindex.results.size > 0 %}
<p>Found about {{ searchindex.approximate_total_hits }} matches:</p>
{% for result in searchindex.results %}
<h3><a href="{{ result.url | escape }}">{{ result.title | escape }}</a></h3>
<p>{{ result.fragment }}</p>
{% endfor %}
{% else %}
<p>Your query returned no results.</p>
{% endif %}
{% endsearchindex %}



Returns an approximate count of total hits matching the index query.

Note that due to the way the search index works in regards to security filtering and other design factors, this number is only an approximation, and may not exactly match the total number of results available to the current user in some situations.


Returns the page number of the current query.


Returns the maximum page size of the current query.

Note that if you want the actual number of results returned for the current page (as this may be less than the specified maximum page size), use results.size.


Returns the query result page, as search index result objects.

Search Index Results


The underlying entity object for the result.


A relevant short text fragment for the result, with terms matching the specified query highlighted using the <em> HTML tag.

Note that certain types of queries do not support highlighted fragments, such as fuzzy queries (~) and wildcard queries (*). This property will be null in those cases.


The CRM entity ID of the underlying record for the result, as a string.

e.g. 936DA01F-9ABD-4d9d-80C7-02AF85C822A8


The CRM entity logical name of the underlying record for the result.

e.g. adx_webpage


The number of the result, across all result pages, starting from 1.

For example, for the first result of the second page of results, with a page size of 10, this value will be 11.


The Lucene score of the result, as a floating-point value. Results will be returned ordered by this value.


The title of the result.


The URL for the result. This will usually – but not necessarily – be an absolute path for the current application, rather than a full URL.

e.g. /articles/article1/