Stéphane Bullier
|
Friday 31 August 2007 5:35:57 am
Hello, I use 3.9.3 version and I developped a template with search fetch function.
{def $tab_classe_recherche = fetch( 'class', 'list', hash( 'class_filter', array( 'audio','excel','flash','file','powerpoint','quicktime','real_video','windows_media','word' ) ) )
$pagedesign = fetch( 'content', 'object', hash( 'object_id', '54' ) )
$page_limit = $pagedesign.data_map.nbr_objet.content
$search_contentclass_id=array(64,63,57,12,62,81,84,82,61) }
{set $search=fetch( 'content', 'search',
hash( 'text', $search_text,
'class_id', $search_contentclass_id,
'offset', $view_parameters.offset,
'limit', $page_limit ) ) }
{sef $search_result=$search['SearchResult']}
{sef $search_count=$search['SearchCount']}
{sef $stop_word_array=$search['StopWordArray']}
{sef $search_data=$search}
<form id="don_form" action={"/bibliotheque/"|ezurl} method="get">
<fieldset>
<legend>Recherche de fichiers</legend>
<p>
<label for="motclef">par mot clés :</label>
<input type="text" id="motclef" name="SearchText" value="{$search_text|wash}" />
</p>
<p>
<label for="format">Recherche fichiers par :</label>
<select name="SearchContentClassID" id="format">
<option value="-1">Tous les formats</option>
{foreach $tab_classe_recherche as $classe}
<option {switch match=$search_contentclass_id}
{case match=$classe.id} selected="selected" {/case}
{case}{/case}
{/switch} value="{$classe.id}">{$classe.name|wash}</option>
{/foreach}
</select>
</p>
</fieldset>
<div id="div_bouton">
<input type="submit" name="SearchButton" value="Lancer la recherche" class="bouton" />
</div>
</form>
I would like to search content only using 'class_id' parameter and leave empty the field keywords. For that I activated the parameter : AllowEmptySearch=enabled in site.ini of my siteaccess. But there is no result when I search without keyword. Thank for avance for any help. Best regards.
Stéphane
|
David Suela
|
Monday 26 May 2008 8:47:58 am
This doesn't work with version 4.0 I have this code:
{set $search=fetch(content,search,
hash(text,$search_text,
section_id,$search_section_id,
subtree_array,$search_sub_tree,
class_id,$search_contentclass_id,
class_attribute_id,$search_contentclass_attribute_id,
offset,$view_parameters.offset,
sort_by, array('published', false()),
publish_timestamp, array($from_timestamp, $to_timestamp),
limit,$page_limit))}
And always return 0 results. If i change in kernel/search/plugins/ezsearchengine/ezsearchengine.php
- if ( $searchPartsArray === null && $this->TempTablesCount == 0 ) + if ( count($searchPartsArray) == 0 && $this->TempTablesCount == 0 ) it works.
xsto.info <el acceso a la información>
http://xsto.info
http://dominios.coop
|