[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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:38:23
Script start
Timing: Jan 18 2025 18:38:23
Module start 'layout'
Timing: Jan 18 2025 18:38:23
Module start 'content'
Timing: Jan 18 2025 18:38:23
Module end 'content'
Timing: Jan 18 2025 18:38:23
Script end

Main resources:

Total runtime0.5657 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.1641152.6563
Module start 'layout' 0.00580.0039 740.820339.5078
Module start 'content' 0.00970.5544 780.3281621.0625
Module end 'content' 0.56410.0016 1,401.390620.0938
Script end 0.5657  1,421.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5982160.0002
Check MTime0.00130.2307160.0001
Mysql Total
Database connection0.00060.105710.0006
Mysqli_queries0.488786.3824680.0072
Looping result0.00060.1101660.0000
Template Total0.532594.120.2662
Template load0.00230.407820.0012
Template processing0.530293.716820.2651
Template load and register function0.00020.037010.0002
states
state_id_array0.00110.198010.0011
state_identifier_array0.00090.153920.0004
Override
Cache load0.00200.3482360.0001
Sytem overhead
Fetch class attribute can translate value0.00050.097130.0002
Fetch class attribute name0.00120.218780.0002
XML
Image XML parsing0.00140.244730.0005
class_abstraction
Instantiating content class attribute0.00000.0043100.0000
General
dbfile0.00110.1911230.0000
String conversion0.00000.001840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs