Or Operator

Matching One of Many Values

The or operator allows you to specify a list of values that can match a field. If any of the values matches, the entire clause is a match.

For example: To search for all organizations whose name is "Google" or "Facebook":

type:Organization strict:name:or("Google", "Facebook")

Matching One of Many Conditions

The or operator allows you to match one of many clauses.

For example: To search for all organizations that either have the exact name "Microsoft Corporation" or have over 100,000 employees, you can query:

type:Organization or(strict:name:"Microsoft Corporation", nbEmployees>100000)

📘

Expressions inside an or operator should be comma-separated.

This query

type:Organization or(
   isPublic:false nbEmployeesMax<1000,
   isPublic:true nbUniqueInvestors>=10)

has the following expressions in the OR clause:

  1. isPublic:false nbEmployeesMax<1000 (both clauses have to match the entity)
  2. isPublic:true nbUniqueInvestors>=10 (both clauses have to match entity)

And it's different from

type:Organization or(isPublic:false, nbEmployeesMax<1000)

which has the following expressions in the OR clause, either of which can match:

  1. isPublic:false
  2. nbEmployeesMax<1000

Or operators can also be nested.

For example: To search for all organizations that are either in San Francisco or New York OR that have a CEO who was either educated at Stanford or Harvard OR who was previously or currently employed by Facebook, Google, or Microsoft, specify:

type:Organization or(locations.city.name:or("San Francisco", "New York"), ceo.{educations.from.str:or("Stanford", "Harvard") employments.employer.name:or("Facebook", "Google", "Microsoft")})

For example: To search for all articles mentioning data privacy that also mention Facebook, Google, or Microsoft:
type:Article text:"data privacy" text:or("Facebook" , "Google" , "Microsoft") sortBy:date

Or use DiffbotIDs and constrain to articles with tagged/linked entities:

type:Article text:"data privacy" tags.uri:or("https://diffbot.com/entity/Cbm4UJoSuP1esww1rsLvu9g", "https://diffbot.com/entity/CUFq-3WlpNsq0pvfUYWXOEA", "https://diffbot.com/entity/CIsFKrN_ZNLSWsvxdQfWutQ") sortBy:date