Share » Forums » Developer » Search/Advanced search problems with...

Search/Advanced search problems with a user defined page limit

Search/Advanced search problems with a user defined page limit

Saturday 17 May 2003 12:11:12 pm - 8 replies

Modified on Saturday 17 May 2003 12:12:49 pm by Paul Forsyth

Author Message

Ekkehard Dörre

Tuesday 20 May 2003 4:32:54 am

narrowed_search working now

http://ez.no/developer/ez_publish_3/contributions/advancedsearchtpl

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Paul Forsyth

Monday 26 May 2003 3:28:39 am

thanks ekke!

I had just started to notice that i needed to add more info to the the form.

btw, in your code you have:

'SearchContentClassAttributeID=',$search_contentclass_id

but maybe it should be:

'SearchContentClassID=',$search_contentclass_id

as attribute is another field altogether.

paul

pps, adding:

'&SearchLimit=',$page_limit

along with the code modification to the advancedsearch.php i gave in my first post seems to work well.

Jan Borsodi

Monday 25 August 2003 4:08:20 am

With 3.2 you can search using a template fetch operator, there you can add limits, offsets and any other search parameter found in advancedsearch.php.

http://ez.no/developer/ez_publish_3/documentation/customization/components/search/search_operator

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Paul Forsyth

Wednesday 27 August 2003 3:04:35 am

Thanks Jan,

With the new way of searching does this mean the old way through a submit will be depracted in future releases? Are ez recommending using the new fetch method?

I notice that bug i filed is marked as fixed but it is not. While the new fetch method may work the other method of using page limit to control the number of results returned is still the same. You can set the page limit in your template file but it is not read by the advancedsearch.php script. The bug fix remains the same: stick in the code to recognise the post variable.

This is with ez3.2 beta 1.

paul

Jan Borsodi

Thursday 28 August 2003 4:16:50 am

> With the new way of searching does this mean the old way through a submit will be depracted in future releases? Are ez recommending using the new fetch method?

You will have more flexibility with the new search operator, it also means you can use it in other templates for instance to replace a normal list fetch.

> You can set the page limit in your template file but it is not read by the advancedsearch.php script. The bug fix remains the same: stick in the code to recognise the post variable.

Ah, I though you only wanted template controlled page limit. But this allows you to set the limit from another page, I'll add it.

But I think there should be another check in the code to see if the limit is over a specific max value, if it is the limit is set to the max limit value. That way it's not possible for users to set an limit of something like 10000 which could easily break the server. The limit could be in a .ini file to allow site adminstrators to tweak it, 30 is a good default I guess.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Jan Borsodi

Thursday 28 August 2003 4:20:48 am

It seems it's already present in 3.2, the post variable is called SearchPageLimit and the template variable search_page_limit. The $pageLimit is only used for the old code which does the search in PHP.

It also seems that the search_page_limit is not set in content/search, I'll add that too with the limiter.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Paul Forsyth

Thursday 28 August 2003 4:52:54 am

I noticed search_page_limit. I thought this would be what i wanted but if you search the php this value doesn't get passed into the ezsearch call, only $pageLimit does. $searchPageLimit is set but isnt used except to set the tpl result with.

Paul

Paul Forsyth

Thursday 28 August 2003 4:56:51 am

Thought i'd clarify what i want!

With 3.1 I designed a new advancedsearch.tpl to use the results coming from the advancedsearch.php. This still works but i need to set $pageLimit to the value i want, something different than 10. An upper bound on this value is good to have.

3.2 has the new template search but at the moment i can't spend the time redesigning the template to accomodate this. The php still works with my tpl file. Since the 3.2 code also still uses $pageLimit to define the number of search objects returned i would like that fix to be put in to allow me to set pageLimit.

paul

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu