1. Knowledge Base
  2. Creating a Search

Creating Boolean Queries

PeakMetrics supports a wide variety of advanced search tools. Here we provide information about what search tools you have access to and how best to use them.

To create an alert using Boolean, follow the first two steps for creating an alert.

However, instead of using any of these boxes:

Include all of these phrases
Include at least one of these phrases 
Exclude all of these phrases

…You're going to use the Advanced Search function. 

Here's a breakdown of how your query translates. 

Booleans

By default, we match exact phrases. A search for “immigration rights” will look explicitly for the phrase “immigration rights”.

You can customize this by using:

1. AND (this term must be present)
example: “immigration rights” AND children
translates to “immigration rights” and children

 

2. OR (either term must be present)

example: “immigration rights” OR “undocumented rights”

translates to “immigration rights” or “undocumented rights”

 

3. NOT (this term must not be present)
example: “immigration rights” -children

translates to “immigration rights” but not children.

Understanding Boolean Operators

  • "cat OR black" - this will find all documents where the words "cat" or "black" exist.

  • "cat || black" - same as above, as || is the same as OR

  • "cat AND black" - this will find all documents where the words "cat" and "black" exist.

  • "cat black" - same as above, as AND operator is the default one.

  • "cat || black" - same as above, because | isn't any keyword and interpreted as a regular token.

Grouping

Multiple terms or clauses can be grouped together with parentheses, to form sub-queries:

(quick OR brown) AND fox

Search by Author

Use this syntax to search by an author's name or social handle:

Author:Cristiano

Search within Headline

Use this syntax to search by the headline of an article:

title:"Christiano Ronaldo"

Wildcards

Wildcard searches can be run on individual terms, using ? to replace a single character, and * to replace zero or more characters:

qu?ck brown fox
 

Proximity searches

While normal searches (eg "john smith" ) expect all of the terms in exactly the same order, a proximity query allows the specified words to be further apart or in a different order. In the same way that fuzzy queries can specify a maximum edit distance for characters in a word, a proximity search allows us to specify a maximum edit distance of words in a phrase:

"fox quick"~5

The closer the text in a field is to the original order specified in the query string, the more relevant that document is considered to be. When compared to the above example query, the phrase "quick fox" would be considered more relevant than "quick brown fox".

 

Find more advanced operators that are available to you in our Advanced Guide to Boolean Searches article.