kingsun he
|
Tuesday 07 September 2010 12:20:27 am
I use the search function of ezpublish like
{def
$search=fetch( 'content', 'search',
hash( 'text',$search_text,
'class_id', 22,
'section_id',6,
'class_attribute_id',202,
'sort_by',array( 'attribute',
true(),
'product/title' ),
'offset',$view_parameters.offset,
'limit',$page_prod_limit
) )
$search_prod_result = $search['SearchResult']
$search_prod_count=$search['SearchCount'] } But now I want to use the ezfind to search, the code should be
{def
$search_text = ezhttp( 'SearchText','get')
$page_prod_limit=5
$search = fetch( ezfind,search,
hash( 'query', $search_text,
'class_id', 22,
'section_id',6,
'sort_by', hash( 'product/title_web', 'asc' ),
'offset',$view_parameters.offset,
'limit',$page_prod_limit
))
$search_prod_result = $search['SearchResult']
$search_prod_count=$search['SearchCount'] } How can I use the class_attribute_id filter in the code for ezfind ? anybody help me ?
|
kingsun he
|
Tuesday 07 September 2010 1:59:35 am
I have found the solution with the help The code should be:
{def
$search_text = ezhttp( 'SearchText','get')
$page_prod_limit=5
$search = fetch( ezfind,search,
hash( 'query', '',
'class_id', 22,
'section_id',6,
'filter', concat('product/title_web:', $search_text),
'sort_by', hash( 'product/title_web', 'asc' ),
'offset',$view_parameters.offset,
'limit',$page_prod_limit
))
$search_prod_result = $search['SearchResult']
$search_prod_count=$search['SearchCount'] } And Change the DatatypeMap[ezstring]=string to DatatypeMap[ezstring]=text in ezfind.ini. update the index again.
|