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

eZ debug

Timing: Jan 18 2025 15:05:02
Script start
Timing: Jan 18 2025 15:05:02
Module start 'content'
Timing: Jan 18 2025 15:05:03
Module end 'content'
Timing: Jan 18 2025 15:05:03
Script end

Main resources:

Total runtime0.9547 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.0938180.8047
Module start 'content' 0.00710.7930 769.8984626.1719
Module end 'content' 0.80010.1545 1,396.0703341.0313
Script end 0.9547  1,737.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.3937210.0002
Check MTime0.00140.1470210.0001
Mysql Total
Database connection0.00130.133310.0013
Mysqli_queries0.879792.14362050.0043
Looping result0.00190.19392030.0000
Template Total0.927097.120.4635
Template load0.00190.198720.0009
Template processing0.925196.898220.4626
Template load and register function0.00010.008410.0001
states
state_id_array0.00120.128510.0012
state_identifier_array0.00100.106820.0005
Override
Cache load0.00160.1698360.0000
Sytem overhead
Fetch class attribute can translate value0.00100.109940.0003
Fetch class attribute name0.00100.103980.0001
XML
Image XML parsing0.00130.139540.0003
class_abstraction
Instantiating content class attribute0.00000.0016100.0000
General
dbfile0.00350.3683340.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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