Controlling search order with nesting
To understand nesting, it's important to know that most databases follow a specific order when processing search terms: NOT is processed first, followed by AND, then OR. This means the database will first group and search terms connected by AND before considering those connected by OR, which can affect your results.
Nesting is a technique that uses parentheses to control the order in which search terms are processed. By grouping terms with parentheses, you can tell the database exactly how to combine them, overriding the default logic and improving the accuracy of your search results. Search terms inside the parentheses are processed first, then combined with the terms outside the parentheses.
Using nesting in database searches
The most common way to use nesting is to group multiple search terms that represent the same concept using the OR operator inside parentheses, then connect that group to other search terms representing different concepts using AND.
Here's an example:
(youth OR teens OR adolescents) AND "video games"
Essentially, this search statement tells the database to:
- Retrieve records containing at least one of the terms youth, teens, adolescents.
- From those results, narrow down to records that also include the term video games.