LabelToDisplay) * @param array $SearchValues Values set for this search * @param int $TypeMask Bitmask of MetadataSchema::MDFTYPE_ values * specifying which fields to display */ function DisplayLimits($Fields, $SearchParameters, $TypeMask) { $NumberOfListItems = 6; $NumberOfListItemsForFlags = 2; print "
"; foreach ($Fields as $FieldId => $DisplayName) { $Field = new MetadataField($FieldId); if ($Field->Type() & $TypeMask) { $CurrentValues = $SearchParameters->GetSearchStringsForField($FieldId); $CurrentValues = ConvertValueNamesToIds($Field, $CurrentValues); $PossibleValues = DeterminePossibleValues($Field); $DisabledOptions = DetermineDisabledValues($Field, $PossibleValues); $AllowMultiple = ($Field->SearchGroupLogic() == SearchEngine::LOGIC_OR) || ($Field->AllowMultiple()); print "
" ."" .htmlspecialchars($DisplayName)."
"; $OptionList = new HtmlOptionList( "F_SearchLimit".$FieldId."[]", $PossibleValues, $CurrentValues ); $OptionList->MultipleAllowed( $AllowMultiple ); $OptionList->DisabledOptions( $DisabledOptions ); $OptionList->Size( ($Field->Type() == MetadataSchema::MDFTYPE_FLAG) ? $NumberOfListItemsForFlags : $NumberOfListItems ); $OptionList->PrintHtml(); print "
"; } } print "
"; } ?>

# Advanced Search

(Need Help?)

Field | Search Terms
--- | ---
GetKeywordSearchStrings(); } else { # if this is a multi-field search, display the value from # the first field as the remainder should all be identical $FieldIds = explode("-", $FieldId); $CurrentValues = $H_SearchParameters->GetSearchStringsForField( current($FieldIds) ); } # if we have no values for this field, add a single empty value # so that the field is still displayed if (count($CurrentValues) == 0) { $CurrentValues = array(""); } # iterate over all the currently set values, printing # corresponding HTML elements for each foreach ($CurrentValues as $CurrentValue) { print "
" .""; $OptionList = new HtmlOptionList( "F_SearchCat".$SearchCatIndex, $H_FieldsHavingTextForms, $FieldId ); $OptionList->AddAttribute("title", "Search Field ".$SearchCatIndex); $OptionList->PrintHtml(); print " | " ."" ."
"; $SearchCatIndex++; } } ?>

## Limits (Optional)

Show all Hide all
$Limits) { ?>
1) { ?> [+–]
Save Search As: Sort by: PrintHtml(); ?> Records per page: 5, 10 => 10, 20 => 20, 30 => 30, 50 => 50, 100 => 100); $OptList = new HtmlOptionList("F_RecordsPerPage", $DisplayOptions, $H_RecordsPerPage); $OptList->PrintHtml(); ?>
IsLoggedIn()) { ?>

## Load Saved Search:

" ."

\n"; foreach ($H_SavedSearches as $SearchId => $Search) { try { $Descrip = addslashes(strip_tags( $Search->SearchParameters()->TextDescription())); print "
- " .htmlspecialchars($Search->SearchName())."
\n" ; } catch (Exception $e) { ; # continue on if search data was invalid } } print "

\n"; } ?>

### 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.

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)
  > `>= ten 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.

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.

Last Modified

  To search for when a field was last modified, enter a `@` symbol followed by a date:

  > `@ Feb 20 2016` (changed on or since 2/20/16)
  > `@ five days ago` (changed within the past 5 days)

  Comparison operators can also be used:

  > `@< February 20 2016` (last changed before 2/20/16)

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