Advanced search

This is a Stub article. Help the eZ Publish community by expanding it!

About

eZ publish provides an advanced search module view which can be customized in many flexible ways.

The advance search module path is '/content/advancedsearch'. To use this module build an HTML form with pre-defined POST variables.

List of POST variables accepted:

  • "SearchText" - usually a text input field to allow to enter the search terms.
  • "PhraseSearchText" - usually a text input field that matches an exact search phrase.
  • "SearchContentClassID" - Limit the search result to specific content classes. Use "-1" for all content classes. Sometimes a drop down option list.
  • "SearchContentClassAttributeID" - Limit the search result to specific content class attributes.
  • "SearchDate" - Limit the search results to after specified date. Use "-1" for date.
  • "SearchTimestamp" - Limit the search results to after specified timestamp.
  • "SearchSectionID" - Limit the search results to a specific section. Use "-1" for all sections.
  • "SubTreeArray" - Limit the search results to specific array of subtrees.
  • "SearchPageLimit" - Limit the search results displayed by convention. Often a hidden variable. Here is an example of the convention.
function pageLimit( $searchPageLimit )
{
    switch ( $searchPageLimit )
    {
        case 1:
            return 5;
 
        case 2:
        default:
            return 10;
 
        case 3:
            return 20;
 
        case 4:
            return 30;
 
        case 5:
            return 50;
    }
}
 
</pre>

There are more POST variables that the advanced search understands. Review the search module view for additional variables.

Reference