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

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 16:25:41
Script start
Timing: Jan 18 2025 16:25:41
Module start 'layout'
Timing: Jan 18 2025 16:25:41
Module start 'content'
Timing: Jan 18 2025 16:25:42
Module end 'content'
Timing: Jan 18 2025 16:25:42
Script end

Main resources:

Total runtime1.0088 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.0469152.6250
Module start 'layout' 0.00650.0039 741.671939.4609
Module start 'content' 0.01030.9969 781.1328584.4766
Module end 'content' 1.00730.0015 1,365.609412.1563
Script end 1.0088  1,377.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3598160.0002
Check MTime0.00150.1504160.0001
Mysql Total
Database connection0.00080.081310.0008
Mysqli_queries0.952894.4448620.0154
Looping result0.00070.0742600.0000
Template Total0.975096.620.4875
Template load0.00210.212420.0011
Template processing0.972996.433020.4864
Template load and register function0.00020.019510.0002
states
state_id_array0.00150.147810.0015
state_identifier_array0.00190.190320.0010
Override
Cache load0.00190.1843290.0001
Sytem overhead
Fetch class attribute can translate value0.00100.102730.0003
Fetch class attribute name0.00130.125250.0003
XML
Image XML parsing0.00080.082530.0003
class_abstraction
Instantiating content class attribute0.00000.001050.0000
General
dbfile0.00080.0775160.0000
String conversion0.00000.001040.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs