A more complex Search: How?

Author Message

PaoloMellerio kk

Monday 29 December 2003 4:55:16 am

Hi,

I've created a specific class for apartments which i must show on my site; among the others, in this class I've the Attribute "Area" (id:163), "Rooms" (id:164) and "Bathrooms" (id:165). The question is: is there a way to create a search engine which works in accordance with the values of these Attributes? That is to say it is possible to use a form to specify one value for the attribute "Area", one for the attribute "Rooms" and one for the attribute "Bathrooms ", and the search engine shows me the apartments which have "more or equal" the Area value specified in the form AND "more or equal" the number of Rooms value specified in the form AND "more or equal" the number of Bathrooms value specified in the form? In other words, is it possible to create a search on a class based on the values of three (or more) attribute_id of this class?

If yes, HOW?

THX in Advice

Paolo Mellerio (Clikka!com)

Paolo Mellerio
http://www.clikka.com

Marco Zinn

Monday 29 December 2003 8:40:52 am

oh-oh...
I think, you will to code a (search) extension for that.
While it should be easy to match for ONE attribute, i think, ez is not prepared to search for multiple attributes including logical operator handling ("more than"). I think, the search engine is trimmed for textual searches and does not know about the order of numbers.
The Template operator (http://ez.no/developer/ez_publish_3/documentation/customization/components/search/search_operator) defintly is not prepared to do this, but maybe the ezPublish classes (ezSearch::search) are able to help you. In any case, i think, you need some PHP coding for that.

Marco
http://www.hyperroad-design.com

Peter Szmulik

Monday 29 December 2003 3:17:26 pm

Hi Paolo

I'm trying to understand this myself for a similar need. My example would be similar to this:
http://uk.pricerunner.com/computing/computers/laptops/browse

Most of the attributes in the example are simple true/not true, but processor speed is not. I belive they solved this by saying processor speed between e.g. 900 and 1200MHz which means that this info (in one form or another) would need to be stored as an attribute in the object (presumably together with the actual speed to be displayed for the user).

I would be very grateful if someone could verify that this would not be totally wrong in eZ Publish :-)

Best Regards & Happy New Year to everyone!
Peter

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 30 2025 22:27:35
Script start
Timing: Jan 30 2025 22:27:35
Module start 'layout'
Timing: Jan 30 2025 22:27:35
Module start 'content'
Timing: Jan 30 2025 22:27:35
Module end 'content'
Timing: Jan 30 2025 22:27:35
Script end

Main resources:

Total runtime0.0224 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.1328151.2109
Module start 'layout' 0.00540.0038 739.3438220.6875
Module start 'content' 0.00920.0116 960.0313997.7891
Module end 'content' 0.02080.0015 1,957.820333.9922
Script end 0.0223  1,991.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002410.6738140.0002
Check MTime0.00104.3953140.0001
Mysql Total
Database connection0.00083.501810.0008
Mysqli_queries0.002611.820130.0009
Looping result0.00000.089610.0000
Template Total0.00114.810.0011
Template load0.00083.564710.0008
Template processing0.00031.185710.0003
Override
Cache load0.00052.397110.0005
General
dbfile0.00020.998180.0000
String conversion0.00000.040540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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