Forums / General / [resolve] No result of avanced search with search_text empty

[resolve] No result of avanced search with search_text empty

Author Message

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&eacute;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

André R.

Friday 31 August 2007 6:02:33 am

[SearchSettings]
AllowEmptySearch=enabled
EnableWildcard=true
MinCharacterWildcard=0 

and search for *

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Stéphane Bullier

Friday 31 August 2007 7:46:12 am

Hi André,

Thank you very much for your answer.

It's perfect.

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

André R.

Tuesday 27 May 2008 12:34:34 am

Could you please add a bug report in the issue tracker?

I have patched the enhanced version of eZ Search engine:
http://projects.ez.no/ezsearchpro

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

David Suela

Tuesday 27 May 2008 2:21:16 am

Ok. Bug reported.

xsto.info <el acceso a la información>
http://xsto.info
http://dominios.coop