Forums / Developer / A more complex Search: How?

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