Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

list

Summary

Fetches the phrases that have been searched ordered by their usage frequency.

Usage

fetch( 'search', 'list',
         hash( [ 'offset', offset, ]
               [ 'limit',  limit   ] ) )

Parameters

NameTypeDescriptionRequired
offset integer The offset to start at. No.
limit integer The number of items that should be returned. No.

Returns

An array of hashes (see below) or FALSE.

Description

This function fetches the phrases that have been searched on the site. The phrases are ordered by their usage frequency. If two or more phrases have the same usage frequency, they are ordered by the number of nodes that match the search conditions.

The "offset" and "limit" parameters are optional and can be used to limit the result. If the "offset" and "limit" parameters are omitted, the function will return all the search phrases.

The function returns an array of hashes. The hashes consist of the following elements:

Key

Type

Description

id

string

The ID number of the search phrase.

phrase

string

The text of the search phrase.

phrase_count

string

The number of times the phrase has been searched for.

result_count

string

The number of nodes that match the search conditions (average search results that have been returned).

If no search phrases are found, the function returns FALSE.

Examples

Example 1

{def $search_list=fetch( 'search', 'list' ) )}
{foreach $search_list as $s}
        {$s.id } : {$s.phrase}<br />
{/foreach}

Outputs all phrases that have been searched for along with their ID numbers.

Example 2

{def $search_list=fetch( 'search', 'list', hash( 'limit','10'  ) )}
{foreach $search_list as $s}
        {$s.phrase } : {$s.phrase_count}<br />
{/foreach}

Outputs the ten most frequently searched phrases and their usage frequency.

Julia Shymova (23/04/2007 2:48 pm)

Balazs Halasy (24/04/2007 6:41 pm)

Julia Shymova, Balazs Halasy


Comments

There are no comments.