A search expression consists of a sequence of terms and operators. Search terms are words or phrases that must appear as values in the study records returned by the search. Search operators affect which studies are returned and their rank order in retrieval sets by changing how the search terms are contextualized or interpreted. In general, operator precedence (from highest to lowest) is as follows: search terms and source operators, the NOT operator and context operators, the AND operator, and the OR operator.
The following operator types are described in the sections below:
Boolean operators connect search terms and define their logical relationship.
|OR||youth OR teen||A binary operator used to retrieve study records containing either the left or right subexpression, or both. The weighted score for determining rank order in retrieval sets will be higher when both the left and right subexpressions are present in a study record.|
|AND||heart AND attack||A binary operator used to retrieve study records containing both the left and right subexpressions.|
|NOT||bethesda NOT maryland||A unary operator that acts only on the right subexpression. It is used to retrieve study records that do not contain the right subexpression.|
Grouping operators group search terms or operators in a query.
|" "||"back pain"||Forces a sequence of words to be treated as a phrase.|
|()||(acetaminophen OR aspirin) AND NOT (heart failure OR heart attack)||Used to increase operator precedence in a search expression.|
Context operators, which control how search terms are evaluated, are immediately followed by parameters in square brackets without any spaces. All context operators have the same precedence as the NOT operator and apply to the subexpression on their right, which immediately follows the right square bracket without a space in between.
Declares the degree to which a search term needs to match the text in an API field.
There are four choices:
||Defaults to Contains when the search expression does not include a COVERAGE operator.|
Declares the degree to which a search term may be expanded. There are five choices:
||Defaults to Relaxation when the search expression does not include an EXPANSION operator.|
|AREA||AREA[InterventionName]aspirin||Declares which search area should be searched. Search areas are defined on the ClinicalTrials.gov Search Areas page. In addition to specifying search areas, it is possible to specify a field from the study structure. Any field from the study structure is searchable.|
|SEARCH **||heart attack AND SEARCH[Location](AREA[LocationCity]Portland AND AREA[LocationState]Maine)||Declares which subsection of the study structure should be searched. For example, this operator can be used to search for a city and state within the same location (e.g. Portland, Maine), and exclude cities and states outside of that location (e.g. Portland, Oregon, and Augusta, Maine).|
* The EXPANSION operator interacts with other operators as follows:
** The SEARCH operator restricts search expressions to fields within a data element so that multiple pieces from that data element can be found together. For instance, the Location data element includes LocationCity, LocationState, LocationCountry, and LocationStatus. The SEARCH[Location] operator limits the search to the Location data element.
The following example uses the SEARCH[Location] operator to find site facility locations in the United States that are also recruiting participants:
In contrast, the following search expression, which does not use SEARCH[Location], would also return studies listing facility locations in the United States that are not recruiting and facility locations not in the United States that are recruiting:
Source operators find studies, similar to search terms. All source operators have the same precedence as a search term.
|MISSING||AREA[ResultsFirstPostDate]MISSING||Finds study records that have no values in the search area specified as a parameter.|
Finds study records in the search area that have a value greater than or equal to the first parameter (e.g., 01/01/2015) and less than or equal
to the second parameter (e.g. MAX) in the search area. Each search area (e.g., ResultsFirstPostedDate) has a specified ordering,
Note: The RANGE operator will not retrieve study records with no values in the search area.
|ALL||ALL||Retrieves all study records in the database.|
Scoring operators are used to adjust the rank order of search results by recency of dates or size of values.
|TILT||TILT[StudyFirstPostDate]"heart attack"||Biases the scoring and rank ordering of study records in favor of the subexpression to the right by imposing a scoring penalty based on the ordering of API field values for the search area provided as a parameter (e.g., StudyFirstPostDate), with higher-ordered values having a lower penalty (e.g., more recent dates) than lower-ordered values (e.g., earlier dates). Use the TILT operator with API fields that are ordered, such as date fields.|