Coding Advanced Search Pages
EPA builds all web content in the Drupal WebCMS as of January 2013. All new microsites and resource directories will be created using Drupal. There is still content on EPA's legacy servers and this content will be maintained there until it is transformed and moved into the Drupal WebCMS. The following information should be used only for minor updates/maintenance of existing pages; any significant updates or revisions to existing pages should be done in the context of One EPA Web content transformation into the Drupal WebCMS.
OEI will provide basic filtered search capabilities for Drupal WebCMS that do no require the author to code their own search form. Instructions for specialized, dedicated search pages on Drupal WebCMS will be provided shortly.
An advanced search page enables a user to perform more advanced searches than with standard search. It offers all of the options of standard search, plus:
- the ability to search within specific fields, such as title, keywords or description
- the ability to search using Boolean operators
NOTE: A program or region would typically have a simple search box on all of their HTML pages, but only one or a few advanced search pages. If you have an advanced search page for your area, you should add the areasearchurl parameter to all of your basic search pages, so that the "Advanced Search" link in the search results will point to your advanced search page.
On this page:
Builld an Advanced Search Form
The easiest way to build an advanced search page for your area is to copy the public access or intranet advanced search page:
and add the filter, fld and areaname parameters for your area (see " Create a Web Area Search Form").
Fields available to advanced search
|audience||For future expansion – the intended audience for this page|
|author||Populated from author metatag|
|epa_collection||"metaboth" or "all". Metaboth indicates document is in WEBI or iWEBI.|
|epa_group||Populated from "group" metatag|
|epa_title||Untruncated preferred title|
|homepage||1 if designated as homepage in WEBI, otherwise blank or 0|
|keyword||Keywords from metatags + WEBI keywords if found|
|metacoll||For future use|
|object-type||Full MIME-Type of document|
|rating||WEBI page rating|
|searchfirst||Composite field used internally|
|searchsecond||Composite field used internally|
|textw||Words anywhere in the document|
|tssms||Account code for document|
Coding the advanced search form
Advanced search is implemented as a separate servlet in the epasearch webapp. For public access, the action parameter of your form should point to http://nlquery.epa.gov/epasearch/advanced. For intranet, the URL is http://nlintrasearch.epa.gov/epasearch/advanced.
All of the parameters and rules for basic search apply to advanced search with one exception – there is no querytext parameter. Instead, query text is specified using four pairs of parameters. The first of each pair is a text box into which the user types his search terms. The second of each pair is the name of the field to search in. This is typically implemented using a dropdown.
In most cases, you should provide a textbox of each of the four text fields, each paired with a dropdown for selecting the field to search. The default fieldname is textw (fulltext).
|Text field||Operator||Fieldname field|
|anyquery||Any of these terms||anyin|
|allquery||All of these terms||allin|
|nonequery||None of these terms||nonein|