GetFieldByName($FieldTypesOrFieldName)); } else { $Fields = $Schema->GetFields($FieldTypesOrFieldName); } # set up a counter for the loop $Counter = 0; foreach ($Fields as $CurrentField) { # if limit field is marked to be used in Advanced Search if ($CurrentField->Enabled() && $CurrentField->IncludeInAdvancedSearch() && ($G_User->HasPriv($CurrentField->ViewingPrivileges()) || $G_User->HasPriv($CurrentField->EditingPrivileges()) )) { if (($CurrentField->Type() & (MetadataSchema::MDFTYPE_OPTION | MetadataSchema::MDFTYPE_FLAG | MetadataSchema::MDFTYPE_USER)) || $CurrentField->Name() == "Cumulative Rating") { # print entry and increment counter if ($Counter) { print(", "); } print("".strtolower($CurrentField->GetDisplayName()).""); $Counter++; } } if (is_numeric($ListLength) && $Counter >= $ListLength) { print(", and more"); break; } } } # print a search limit form entry function PrintSearchLimitFormEntry($LimitName, $LimitType) { if ($LimitType & (MetadataSchema::MDFTYPE_OPTION | MetadataSchema::MDFTYPE_FLAG | MetadataSchema::MDFTYPE_USER | MetadataSchema::MDFTYPE_TREE)) { $ListLength = ($LimitType == MetadataSchema::MDFTYPE_FLAG) ? 1 : 6; ?>
Id(); ?>[]" style="padding-left: 1px;">:
Id(); ?>[]" style="padding-left: 1px;">Minimum Rating:
0) { # pull out the fields that can show in advanced searches $FieldList = ListFieldsHavingTextForms(); # iterate over the search groups foreach ($G_SearchGroups as $GName => $GValue) { # get fields names for this search group $GroupFields = array_keys($GValue["SearchStrings"]); # searches call it a "XXXKeywordXXX", when it's a keyword if (($Key = array_search("XXXKeywordXXX", $GroupFields)) !== FALSE) $GroupFields[$Key] = "Keyword"; # add fields allowed in searches to our list foreach (array_intersect($GroupFields, $FieldList) as $Val) $DefaultValues []= $Val; } } # add in defaults, if there weren't already any fields selected foreach (array("Keyword", "Description", "Title", "Subject", "Creator", "Publisher", "Url") as $Val) { if (!in_array($Val, $DefaultValues)) $DefaultValues []= $Val; } } $DefaultValue = ""; # if the form field index maps to a default value if (array_key_exists($FormFieldIndex, $DefaultValues)) { $DefaultValue = $DefaultValues[$FormFieldIndex]; } ?>
IsLoggedIn() && $G_User->HasPriv(PRIV_RESOURCEADMIN)) ? 4 : 2; } if (isset($G_SearchGroups)) { return max(count(SavedSearch::TranslateSearchGroupsToSearchFieldNames( $G_SearchGroups)), $Default); } // Check to see if we've got saved search selections to use elseif ($G_User->IsLoggedIn()) { $SSData = $G_User->Get("SearchSelections"); if (!is_null($SSData)) { $SearchSelections = unserialize($SSData); return max(count($SearchSelections), $Default); } } return $Default; } function DisplayOptionEntry($Value, $Label) { ?> >
:
Minimum Cumulative Rating:
:

# Advanced Search

(Need Help?)

Field | Search Terms
--- | ---

Limits (Optional)

Save Search As: Sort by:
Records per page:
IsLoggedIn()) { ?>
IsLoggedIn() ) { ?>
Manage Your Searches
Load Saved Search:

### Advanced Search Tips

Phrase Searching

  You can search for several words next to each other by enclosing them in quotation marks:

  > `"a key phrase"`

  This also works for keyword searches.

Excluding Terms

  If you want only results that do not mention a specific term, you can exclude that term by prepending a minus sign:

  > `-unwanted`
  > `good words -bad -words`
  > `words we want -"phrase to exclude"`

  This also works for keyword searches.

Exact Matches

  To match a word or phrase exactly, immediately precede it with an equals sign:

  > `=National Nanotechnology Network`
  > `=http://science.org/instruction/index.php`

  This is usually used with URL and Controlled Name fields. Exact match differs from phrase searching in that with an exact match, the content of the field has to be identical to the search string to be considered a match.

Date Ranges

  You can search for dates within a specific range by entering a beginning and end date separated by spaces and a dash:

  > `June 10 2008 - July 19 2010`
  > `5/1/04 - 2/10/12`

  Ranges are inclusive, and most common date formats will work.

Comparisons

  To search for values before or after a certain date, precede the date with the appropriate operator:

  > `> 2009` (after 2009)
  > `<= Feb 20 2010` (on or before 2/20/10)

  It is also possible to specify relative to the current time:

  > `< 90 minutes ago` (less than 90 minutes ago)
  > `>= 10 days ago` (10 or more days ago)

  Comparisons also work with numeric fields:

  > `>= 42` (greater than or equal to 42)
  > `!= 65535` (not equal to 65535)

  For dates, most common formats will work. Comparisons are only for Date, Timestamp, and Number fields.