- Previous Article: [2/3] The Power Search: Syntactic Sugar
Overview of Important Properties
Overview of Basic Operators
To help out with the example below, let us consider the titles of the following two fictitious Signals:
A: "Wireless Energy Transfer"
B: "Energy Transfer without Wires"
Note that string matching is not case-sensitive and that many non-alpha-numeric characters such as dashes (-) are considered white space.
Exact String Match
The equals-operator (=) will return a Signal if the value is exactly matched.
1. label = "Wireless Energy Transfer"
2. label = "Wireless"
- Search 1 will produce Signal A because the title and the value in the search are exactly the same.
- Search 2 on the other hand will not succeed in producing Signal A.
Contains
The contains-operator (CONTAINS) searches for the exact words within the property.
1. label CONTAINS "Wire"
2. label CONTAINS "Wireless"
- Search 1 will produce no results as Signals A and B include words that only begin with Wire but continue on.
- Search 2 will produce Signal A as its title contains the exact word Wireless.
Fuzzy String Match
The tilde-operator (~) will perform a fuzzy string match which will usually produce a larger set of results.
1. label ~ "Wire"
2. label = "Wireless Charging"
- Search 1 will produce both Signals A and B as they include words that include the search value within.
- Search 2 will produce Signal A even though the word Charging doesn't in fact occur in its title. The match of Wireless is sufficient for the fuzzy string match.
Comparison
Different comparison operators (<, <=, >, >=) can be used to compare values. Examples:
newsSiteDomainRank < 1000
publishedDate >= 1577880000000
Notes on Values
Note that for many properties such as the published date, country or the category, it is much easier to use the context inputs as these properties have many values that need to be entered precisely.
Country: For countries, we use the 2-letter ISO country codes.
Published date: We are currently using milliseconds since 01.01.1970. As this is not very practical, we will work on improving this.