Forums / Developer / fetch search in extension

fetch search in extension

Author Message

Nathalie Grimaud

Thursday 02 February 2006 6:05:07 am

In an extension I need to make a search.
In a template I would use :

{def $results=fetch( 'content', 'search', 
  hash( 'text',  'product',
           'class_id',  37,
           'class_attribute_id', 262,
           'subtree_array', array('208') ) )}

What's the equivalent in an extension ?
I tried this but I've got wrong results :

$text = 'product';
$params = array(
		'ClassId' => '37',
		'ClassAttributeId' => '262',
		'SubtreeArray' => array( '208' )
		 ); 
$results =& eZSearch::search( $text , $params );

Nathalie Grimaud

Tuesday 07 February 2006 2:03:09 am

Is there any documentation on ez classes ?
Where can I find help to develop extensions ?

Nathalie Grimaud

Wednesday 15 February 2006 2:43:38 am

I finally found my answer looking in the kernel code...

$text = 'product';
$params = array(
'SearchContentClassID' => 37,
'SearchContentClassAttributeID' => 262,
'SearchSubTreeArray' => array( 208 )
); 
$results =& eZSearch::search( $text, $params);