Custom Scoring

You can use should and must clauses for boosting and ranking results. They can be used to implement a custom scoring function.

should clause

The should operator allows you to specify optional clauses which result in matching entities appearing higher in the search.

For example: to search for all employees currently employed at Google but boost the ones employed in leadership roles, you can use this query:

type:Person employments.{isCurrent:true employer.name:"Google" should:categories.name:"leadership"}

The should:categories.name:"leadership" clause does an optional match on employments.categories.name but boosts those results.

You can specify multiple should clauses. For example: to search for all employees currently employed at Google but boost the ones employed in leadership roles and located in United States, you can use this query:

type:Person employments.{isCurrent:true employer.name:"Google" should:categories.name:"leadership" should:location.country.name:"United States of America"}

When using multiple should clauses, you can specify different weights for clauses using the should[<weight>] syntax where weight is a number between 1 and 100.

For example, to specify double the weight to the categories field, you can use this query:

type:Person employments.{isCurrent:true employer.name:"Google" should[100]:categories.name:"leadership" should[50]:location.country.name:"United States of America"}

The clause should[100]:categories.name has a weight of 100 and the clause should[50]:location.country.name has a weight of 50.

must clause

You can also specify weight for non-optional clauses using the must keyword.

For example, to search for AI companies with optional Series A investment, but giving more weight to AI companies:

type:Organization investments.{should[50]:series:"Series A" isCurrent:true} must[100]:industries:"Artificial Intelligence Companies"