Forums / Setup & design / How does work the search system ?

How does work the search system ?

Author Message

Pascal France

Tuesday 02 December 2008 7:07:28 am

Hi,

In a 3.10.1 version I only use the simple search (search.tpl) and not advancedsearch.

I'm using this template:

design/plain_site/templates/content/search.tpl

witch is a customiszed copy of the template used by default (design/base/templates/content/search.tpl)

I don't understand how does work this template (or the search system) because I can delete this part of the template:

  3 {section show=$use_template_search}
  4     {set page_limit=10}
  5     {set search=fetch(content,search,
  6                       hash(text,$search_text,
  7                            section_id,$search_section_id,
  8                            subtree_array,$search_subtree_array,
  9                            sort_by,array('modified',false()),
 10                            class_id, ezini('ObjetsRecherches', 'ClassesIncluses', 'recherche.ini'),
 11                            offset,$view_parameters.offset,
 12                            limit,$page_limit))}
 13     {set search_result=$search['SearchResult']}
 14     {set search_count=$search['SearchCount']}
 15     {set stop_word_array=$search['StopWordArray']}
 16     {set search_data=$search}
 17 {/section}

...the search system is still working.

The only code nedeed in this template to get results is:

1 {section name=SearchResult loop=$search_result show=$search_result sequence=array(bglight,bgdark)}
2                {node_view_gui view=line sequence=$:sequence use_url_translation=$use_url_translation content_node=$:item}<br />
3{/section}

But in this case, where do the values of $search_result come from ?

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Gaetano Giunta

Tuesday 02 December 2008 7:20:48 am

There is an ini setting that drives the value of $use_template_search.

When false, the php code of the view executes the search, and the template only displays results.
Otherwise, it is up to the template to do everything.
This has the benefit of allowing extra parameters to be added to searches (eg. for drill-down searches, facets) handling them completely in template code.

Principal Consultant International Business
Member of the Community Project Board

Pascal France

Tuesday 02 December 2008 8:20:06 am

Thanks a lot Gaetano,

The setting is «SearchViewHandling» in site.ini and has to be set to «template»

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Emmanuel Courmont

Sunday 22 March 2009 2:40:53 pm

Hi guys,

Look at this post to get more info about the setting to change.

http://ez.no/developer/forum/developer/probleme_with_the_search#msg112135

eZ debug

Timing: Jan 31 2025 05:35:37
Script start
Timing: Jan 31 2025 05:35:37
Module start 'content'
Timing: Jan 31 2025 05:35:37
Module end 'content'
Timing: Jan 31 2025 05:35:38
Script end

Main resources:

Total runtime0.1721 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0101 587.9453180.8359
Module start 'content' 0.01010.0075 768.781398.0078
Module end 'content' 0.01760.1544 866.7891527.8281
Script end 0.1721  1,394.6172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00382.1828200.0002
Check MTime0.00150.8858200.0001
Mysql Total
Database connection0.00110.628710.0011
Mysqli_queries0.117568.26291410.0008
Looping result0.00130.76201390.0000
Template Total0.154189.510.1541
Template load0.00080.490310.0008
Template processing0.153289.004510.1532
Override
Cache load0.00060.332410.0006
Sytem overhead
Fetch class attribute can translate value0.00070.411810.0007
XML
Image XML parsing0.00030.159710.0003
General
dbfile0.01015.8801200.0005
String conversion0.00000.005830.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs