eZ Community » Forums » Developer » content search and multiple sites
expandshrink

content search and multiple sites

content search and multiple sites

Saturday 25 February 2012 4:29:08 pm - 2 replies

Hi there,

I have this following piece of code :

{def $search_subtree_array = array(ezini('NodeSettings', 'RootNode', 'content.ini'))}
{let search=false()}
{section show=$use_template_search}
    {set page_limit=10}
    {set search=fetch(content,search,
                      hash(text,$search_text,
                           section_id,$search_section_id,
                           subtree_array,$search_subtree_array,
                           sort_by,array('modified',false()),
                           offset,$view_parameters.offset,
                           limit,$page_limit))}
    {set search_result=$search['SearchResult']}
    {set search_count=$search['SearchCount']}
    {set stop_word_array=$search['StopWordArray']}
    {set search_data=$search}
{/section}
 
...
 
{/let}

And I supposed it to only search in the subtree representing the site we are in.

But in fact, it search in all the nodes.

Am I doing something wrong ?

Sunday 26 February 2012 10:15:33 am

Are you sure $search_subtree_array is et and it is an array?  I've used this before and it worked as expected.

Sunday 26 February 2012 11:13:19 am

Are you sure $search_subtree_array is et and it is an array?  I've used this before and it worked as expected.

Yes it is. Look at the first line, I create it by my own :

{def $search_subtree_array = array(ezini('NodeSettings', 'RootNode', 'content.ini'))}

And it worked before for me on other projects too.

The RootNode for my siteaccess is 60 and I checked the $search_subtree_tree and it contains one element with the 60 value.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from