Fulltext($search, $entry_type, $sort, $pagesize, $page)
This function searches (all or selected) entry types using the keyword specified, see also Search.
Unlike the function Search, the behavior of fulltext search is that it does not only search the title of a particular entry but also searches the its keywords, short description and html content.
Fulltext Search is ideal for searching entry type that have more than 10 records. If the total records is less than 10, it is possible that the function will return no records even if there are matches is found.
Syntax:
{$archive->Fulltext($search, $entry_type, $sort, $pagesize, $page)}
| Parameter | Default Value | Description | Sample Value |
| $search | n/a | String - keyword that is used to match entry records. | keyword(s) |
| $entry_type | * | String - filters the result by the entry type (comma delimited) | * or news or news,events,books |
| $sort | _date_created DESC | String - sorts the records either ASC or DESC by a selected field. | eventdate DESC |
| $pagesize | 20 | Integer - maximum results per page | 10 |
| $page | 1 | Integer - Selects the records on a particular page | 1 |
Sample Usage:
{assign var="news" value= $archive->Fulltext("second","news","eventdate DESC",10,1)}
{foreach item="$news_item" from=$news}
<h2>{$news_item.title}</h2> <br/>
<i>{$news_item.eventdate|date_format}</i> <br/>
<p>{$news_item._short_description}</p> <br/>
{/foreach}
Sample Output:
Keyword : second<h2>NEWS HEADLINE 2</h2> <br/>
<i>April 18,2008</i> <br/>
<p>News 2: second short description </p> <br/>