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.

Boosting Dedicated Functions

Fetch Function Parameter: boost_functions

Boosts can be passed as function boosts which should be done according to the Solr function query syntax.

The fetch parameter should be specified as:

{set $search=fetch( ezfind,search,
        hash( 'query', $search_text,
        ... ,
        'boost_functions', hash('functions',
array('<boostfunction n>', ...)),
        ...

where 'boost function n' should adhere to technical syntax of Solr functions.

Note: The Solr query syntax is quite elaborate but powerful, and documented on the Solr wiki pages: http://wiki.apache.org/solr/FunctionQuery

For example, the following boost function will favor more recent pages over older ones:

{set $search=fetch( 'ezfind', 'search',
       hash( 'query', $search_text,
            'offset', $view_parameters.offset,
            'limit', $page_limit,
            'sort_by', hash( 'score', 'desc' ),
            'boost_functions', hash('functions',
array('recip(ms(NOW/HOUR,meta_published_dt),4e-12,1000,2)')) ))}

As of eZ Find LS 5.0.0 the mfunctions boost function has been added. The usage is similar to the functions boost function. Here's a usage example:

{set $search=fetch( 'ezfind', 'search',
    hash( 'query', $search_text,
       'offset', $view_parameters.offset,
       'limit', $page_limit,
       'sort_by', hash( 'score', 'desc' ),
       'boost_functions', hash('mfunctions',
 array('recip(ms(NOW/DAY,meta_published_dt),3.16e-11,0.5,0.5)' )) ))}

Note: Alternatively the RawBoostQueries ezfind.ini setting can also be used in order to achieve the same boosting effect.

Ricardo Correia (05/02/2013 12:20 pm)

Ricardo Correia (14/06/2013 3:12 pm)


Comments

There are no comments.