Custom Search Probelm

Author Message

Alessandro Malizia

Thursday 04 October 2007 1:02:16 am

Hi at all, i'm using Ez version 3.9.2 for create a website.
But i've a big problem, i've add a custom search box for a subtree search, using the instructions of this link:

http://ez.no/ezpublish/documentation/customization/components/search/custom_search_box

Now the problem is that when i try the first search, it visualizes to me the resultes exact, but when i try again a new search, it visualizes to me the previous resultes, with the "search text" of the previous search.

It seems to be a cache problem because if i clear cache in the administration interface, and i do again the search there isn't problem. That come before again in i try a second search without clear cache.

Anyone have the solution of this problem?

I have tried with this string:

{set-block scope=root variable=cache_ttl}0{/set-block}

but it doesn't work

HELP ME PLEASE!!!

Daje ROMA Daje!!!

Kristof Coomans

Thursday 04 October 2007 7:30:34 am

HI Allesandro

Where exactly did you add the template code you mentioned? And did you clear template caches afterwards?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Alessandro Malizia

Friday 05 October 2007 1:03:26 am

I have added the code at the beginning of the template where i have written the code for the custom search box, is a template for a specific node. But didn't clear the cache... is that the problem!!

Daje ROMA Daje!!!

Alessandro Malizia

Tuesday 09 October 2007 1:30:10 am

anyone can help me?

Daje ROMA Daje!!!

André R.

Tuesday 09 October 2007 2:08:37 am

Well your question dosn't make sense, first of all you use:

{set-block scope=root variable=cache_ttl}0{/set-block}

Witch hints that this is a node template(content/view), because it will only work in a node template setting the timeout of the viewcache.

content/search and content/advancesearch does not use viewcache, and the templates they use doesn't have any cache blocks. So I guess you have added a cache block on the search result that is causing this, alternatively you have a cache block around {$module_result.content} in your pagelayout that is causing this. In both cases, remove them to fix the problem.

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

Alessandro Malizia

Wednesday 10 October 2007 3:27:56 am

Hi Andrè, i use that code in a similar folder template, that
I have set up for a specific node.

In this template i've added the custom search box, that it gives problems to me.

Daje ROMA Daje!!!

Alessandro Malizia

Tuesday 23 October 2007 3:51:09 am

Sorry but i still have this problem, and i didn't find solution for it.

Daje ROMA Daje!!!

André R.

Tuesday 23 October 2007 4:51:35 am

Could you please specify the following:

* What specific cache do you need to clear in admin to refresh the search result?
( try by clearing one at a time and see if it refreshes the search result )
* Do you have a cache block around the search result?
* If so, why ?
* In what template have you put the template code? give full path please.
* if any overrides are involved please post them to.
* If the template code is not the same as in the tutorial you are pointing to, please post your template code.

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

Alessandro Malizia

Wednesday 24 October 2007 1:48:43 am

<b>* What specific cache do you need to clear in admin to refresh the search result?</b>

I need to clear the Template Cache to refresh the search result

<b>* Do you have a cache block around the search result?
* If so, why ?</b>

i've add this code as someone has suggested in other thread

{set-block scope=global variable=cache_ttl}0{/set-block}

<b>* In what template have you put the template code? give full path please.</b>

i put it in much template fto find a solution:

-design/ezwebin/override/templates/new_intranet_custom_ita.tpl (a modified Folder Template)
-design/ezwebin/override/templates/search_content_ita_new.tpl (a modified "/content/search.tpl" Template)

In the second template i modified only the visualization, while in the first i've add this code:

 

 <form action={"/content/search/"|ezurl} method="get">
 <input class="searchinput" type="text" size="10" name="SearchText" value="" />
 <input type="hidden" name="SubTreeArray" value="186" />
 <input type="submit" value="submit" />
 </form>
 

Daje ROMA Daje!!!

André R.

Wednesday 24 October 2007 2:37:44 am

>I need to clear the Template Cache to refresh the search result

This means you DO have a cache block around the search result.

>I've add this code as someone has suggested in other thread
>{set-block scope=global variable=cache_ttl}0{/set-block}

This has NO effect on "cache blocks", this is to disable "content view cache".
So once again: You need to remove the cache block that is caching the search result.

Here is more abut cache blocks:
http://ez.no/doc/ez_publish/technical_manual/3_10/reference/template_functions/miscellaneous/cache_block

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

Alessandro Malizia

Thursday 25 October 2007 1:36:25 am

I tried this solution, but it is still not working, it seems to be the same.

In the URL the variable SearchText is right, but when it is processed by the template it continue to use the first search text (that i have inserted after the clear cache).

Daje ROMA Daje!!!

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 19 2025 04:34:11
Script start
Timing: Jan 19 2025 04:34:11
Module start 'layout'
Timing: Jan 19 2025 04:34:11
Module start 'content'
Timing: Jan 19 2025 04:34:13
Module end 'content'
Timing: Jan 19 2025 04:34:13
Script end

Main resources:

Total runtime1.2782 sec
Peak memory usage4,096.0000 KB
Database Queries83

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 590.2813152.6250
Module start 'layout' 0.00520.0028 742.906339.4453
Module start 'content' 0.00811.2687 782.3516693.4063
Module end 'content' 1.27680.0014 1,475.757828.1719
Script end 1.2782  1,503.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2512160.0002
Check MTime0.00130.1050160.0001
Mysql Total
Database connection0.00070.057310.0007
Mysqli_queries1.177892.1434830.0142
Looping result0.00110.0882810.0000
Template Total1.239697.020.6198
Template load0.00230.178220.0011
Template processing1.237396.799420.6187
Template load and register function0.00020.018210.0002
states
state_id_array0.00130.100910.0013
state_identifier_array0.00320.252120.0016
Override
Cache load0.00210.1642770.0000
Sytem overhead
Fetch class attribute can translate value0.00060.050830.0002
Fetch class attribute name0.00100.0784140.0001
XML
Image XML parsing0.00300.235130.0010
class_abstraction
Instantiating content class attribute0.00010.0043220.0000
General
dbfile0.00260.2056290.0001
String conversion0.00000.000540.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
11content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
20content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 56
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs