Share » Forums » Extensions » eZ Find: Cross class filter

eZ Find: Cross class filter

eZ Find: Cross class filter

Monday 24 January 2011 7:19:49 am - 3 replies

Author Message

Franck Magnan

Monday 24 January 2011 12:40:55 pm

Hello Anders,

ezfind fetch function looks like :

{set $search=fetch( ezfind,search,
                        hash( 'query', $search_text,
                              'offset', $view_parameters.offset,
                              'limit', $page_limit,
                              'sort_by', hash( 'score', 'desc' ),
                              'facet', $defaultSearchFacets,
                              'filter', $filterParameters,
                              'publish_date', $dateFilter,
                              'spell_check', array( true() ) 
                             ))}

Assuming Article, Product and Persons have class_ids 34, 67 and 55 (for example), you can add one argument to your fetch function to get :

{set $search=fetch( ezfind,search,
                        hash( 'query', $search_text,
                              'offset', $view_parameters.offset,
                              'limit', $page_limit,
                              'sort_by', hash( 'score', 'desc' ),
                              'facet', $defaultSearchFacets,
                              'filter', $filterParameters,
                              'publish_date', $dateFilter,
                              'class_id', array(34, 67, 55),
                              'spell_check', array( true() ) 
                             ))}

Then, ezfind will retrieve only nodes among Articles, Products and Persons.

Hope this helps.

--
Developer at Open Wide

Anders Berre

Tuesday 25 January 2011 12:21:43 am

Hi Franck,

Thanks for taking your time to answer. I think you misunderstod the problem. The problem is not to have define wich classes to use, but to get any other classes as well, when using filter on on of them.

Franck Magnan

Tuesday 25 January 2011 12:08:03 pm

Sorry if I didn't understand your problem.
Perhaps you can read these 3 very interesting tutorials:

hope this helps

--
Developer at Open Wide

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu