I’m trying to implement a search and it works so far except I need to return the total result count. Right now absolute_results gets limited to the limit that is passed through.
<?xml version="1.0" encoding="UTF-8"?>
<news>
{exp:search_fields
search:title="{embed:search}"
search:news_article="{embed:search}"
operator="OR"
channel="news"
parse="inward"}
{exp:channel:entries entry_id="{search_results}" orderby='date' dynamic='no' sort='desc' limit='{embed:limit}' offset='{embed:offset}'}
{if count == "1"}<totalresults>{absolute_results}</totalresults>{/if}
<entry>
<id>{entry_id}</id>
<title>{title}</title>
<teaser>{news_teaser}</teaser>
<article>{exp:xml:encode}{news_article}{/exp:xml:encode}</article>
<start_date>{entry_date}</start_date>
<expiration_date>{expiration_date}</expiration_date>
<featured_start_date>{news_featuredstartdate}</featured_start_date>
<featured_end_date>{news_featuredenddate}</featured_end_date>
<categories>{categories}
<category id='{category_id}' name='{exp:xml:encode}{category_name}{/exp:xml:encode}'>
{/categories}</categories>
</entry>
{/exp:channel:entries}
{/exp:search_fields}
</news>Ideas on how to get the true total count?
Here is the embed page:
{embed="news/search_new" search='{exp:get_parameters get="search"}' limit='{exp:get_parameters get="limit"}' offset='{exp:get_parameters get="offset"}'}