Advanced Search on OSF
The OSF Search interface offers a few options for filtering search results. However, with knowledge of some specific search syntax, you can do even more powerful searching of OSF using specific metadata fields.
- Advanced Search Basics
- Using the Search Page
- Search Via URL
- Combining Parameters
- Advanced Search Parameters
- Affiliated Institution
- Contributor
- Funder/Award Information
- Resource Type
- Title, Description, or Tags
Advanced Search Basics
All of the following queries can be added to the search bar on the OSF search page (https://osf.io/search/). It is also possible to formulate these queries directly into the browser’s address bar. This section outlines basic information about using advanced search syntax. The next section describes the specific search parameters that can be used.
Using the Search Page
When adding the advanced search parameters to the search page, the parameter must be followed by a colon and then the search term with no spaces:
resource_type_general:dataset
The search results shown above are limited to only those objects that are tagged as "dataset" in the resource type metadata field (a list of all of the parameters that can be searched is in the next section).
Search Via URL
The same query can be launched directly into the browser at:
https://osf.io/search/?q=resource_type_general:dataset
Phrase Searching
Quotation marks can be used to surround a phrase containing multiple words.
description:"randomized trial"
Without the quotation marks, the search would be for the term randomized in the description and the word trial appearing anywhere in the object.
The second set of results is much larger and may include many items not relevant to the query. When searching for any name or phrase it is good practice to use quotation marks to reduce non-relevant items in results.
Combining Parameters
More than one query can be combined by using the Boolean operators AND, OR, and NOT.
- AND: retrieves only objects meeting all parameters
- OR: retrieves object with any of the parameters
- NOT: retrieves objects that do not have the parameter following the operator
Boolean operators must be entered as ALL CAPS.
For example:
affiliated_institutions:”University of Maryland” NOT affiliated_institutions:Baltimore
will retrieve objects affiliated with the University of Maryland, but not the University of Maryland, Baltimore.
Queries of different parameters can be also combined:
resource_type_general:dataset AND funder_name:”National Science Foundation”
Combined parameters can also be searched directly in the browser address bar the same way with %20 added in place of blank spaces and %22 in place of quotation marks:
Advanced queries can also be combined with general keyword searches by combining terms without any specific parameter:
affiliated_institutions:”Center For Open Science” metadata
The default for this combination is to imply the Boolean operator OR between terms. The search above, for example, would return all objects affiliated with the Center For Open Science, OR any other object (whether from COS or not) that has a match with the term “metadata” resulting in a very large set of objects.
If instead, only items affiliated with the Center For Open Science that also match the term “metadata” are desired, the Boolean AND operator can be added:
affiliated_institutions:”Center For Open Science” AND metadata
This query returns a much smaller number of results since only those objects meeting both search terms are selected.
Advanced Search Parameters
These basic rules can be used to search using any of the parameters described below. Search terms should be added directly after the colon at the end of the parameter name with no spaces (e.g. contributors.fullname:Smith).