Forums / Setup & design / Customized AND search on several class attributes in one search

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Customized AND search on several class attributes in one search

Author Message

Tore Skobba

Wednesday 11 February 2004 9:25:28 am

Hi

I want to use the new search fetch to make an customized search

ref: http://www.ez.no/ez_publish/documentation/customization/components/search/search_operator
http://www.ez.no/ez_publish/documentation/customization/components/search/templates

More specific I want to search among my registred user (in an customized user class), an example form is this:

Name: Textfield used to enter an name to search for (Searchtext)
Class of: An selection of {1999,2000,2001} used to mark which Class_of to search for, user class have an EZSelection, identifier: class_of.

For example: search for Name="Tore Skobba" having Class of="2000" (class of must then be remapped to the ezselection values {0,1,2}. The remapping is no problem, same thing with searching for each element seperately. But how should I approach the problem of searching on several different class attributes in one search? Is it possible without making an extension?

For example this fetch:
{let search=fetch(content,search,hash(text,'Skobba',class_id,'33',class_attribute_id,array('216','220')))}

Seem to search in my User class(33) with OR, i.e. last name(214)=Skobba OR class_of(216)=Skobba, alternatively if I am using class_of selection as my searchtext: last name=0 OR class_of=0. I want an AND there:).

Any tips?

Hmm maybee I could use an fetch(content, tree with parent node equal my user root folder, then add all my parameters?

Cheers
Tore