Search Filters
(Difference between revisions)
Renato.neves (Talk | contribs) (→Relational Operators) |
Dirceu.tiegs (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | The standard used in [[POST database/people/search|contact search]] is "SQL-like": the syntax is very similar with what we use to query relational databases. Some examples: | |
{| | {| | ||
Line 15: | Line 15: | ||
{| | {| | ||
− | ! align="left" width="200px" | | + | ! align="left" width="200px" | Code |
− | ! align="left" width="200px" | | + | ! align="left" width="200px" | Operation |
− | ! align="left" | | + | ! align="left" | Example |
|+ | |+ | ||
! align="left" width="200px" | and | ! align="left" width="200px" | and | ||
− | | width="200px" | | + | | width="200px" | Conjunction |
| profile.name.formatted = 'Guilherme Silva' and profile.gender = 'male' | | profile.name.formatted = 'Guilherme Silva' and profile.gender = 'male' | ||
|+ | |+ | ||
! align="left" width="200px" | or | ! align="left" width="200px" | or | ||
− | | width="200px" | | + | | width="200px" | Disjunction |
| profile.name.formatted = 'Guilherme Silva' or profile.gender = 'male' | | profile.name.formatted = 'Guilherme Silva' or profile.gender = 'male' | ||
|+ | |+ | ||
! align="left" width="200px" | not | ! align="left" width="200px" | not | ||
− | | width="200px" | | + | | width="200px" | Negation |
| not profile.gender = 'male' | | not profile.gender = 'male' | ||
|} | |} | ||
Line 35: | Line 35: | ||
{| | {| | ||
− | ! align="left" width="200px" | | + | ! align="left" width="200px" | Code |
− | ! align="left" width="200px" | | + | ! align="left" width="200px" | Operation |
− | ! align="left" | | + | ! align="left" | Example |
|+ | |+ | ||
! align="left" width="200px" | = | ! align="left" width="200px" | = | ||
− | | width="200px" | | + | | width="200px" | Equality |
| profile.name.formatted = 'Guilherme Silva' | | profile.name.formatted = 'Guilherme Silva' | ||
|+ | |+ | ||
! align="left" width="200px" | != | ! align="left" width="200px" | != | ||
− | | width="200px" | | + | | width="200px" | Difference |
| profile.name.formatted = 'Guilherme Silva' | | profile.name.formatted = 'Guilherme Silva' | ||
|+ | |+ | ||
! align="left" width="200px" | < | ! align="left" width="200px" | < | ||
− | | width="200px" | | + | | width="200px" | Lesser than |
| profile.id < 100 | | profile.id < 100 | ||
|+ | |+ | ||
! align="left" width="200px" | > | ! align="left" width="200px" | > | ||
− | | width="200px" | | + | | width="200px" | Greater than |
| profile.id > 100 | | profile.id > 100 | ||
|+ | |+ | ||
! align="left" width="200px" | <= | ! align="left" width="200px" | <= | ||
− | | width="200px" | | + | | width="200px" | Lesser than or equals |
| profile.id <= 100 | | profile.id <= 100 | ||
|+ | |+ | ||
! align="left" width="200px" | >= | ! align="left" width="200px" | >= | ||
− | | width="200px" | | + | | width="200px" | Greater than or equals |
| profile.id >= 100 | | profile.id >= 100 | ||
|+ | |+ | ||
! align="left" width="200px" | like | ! align="left" width="200px" | like | ||
− | | width="200px" | | + | | width="200px" | "like" operator |
| profile.name.given_name like 'Guilher%' | | profile.name.given_name like 'Guilher%' | ||
|+ | |+ | ||
! align="left" width="200px" | between | ! align="left" width="200px" | between | ||
− | | width="200px" | | + | | width="200px" | Between :A and :B |
| profile.id between 1 and 3 | | profile.id between 1 and 3 | ||
|+ | |+ | ||
! align="left" width="200px" | in | ! align="left" width="200px" | in | ||
− | | width="200px" | | + | | width="200px" | "in" operator |
| profile.id IN (100, 99, 104) | | profile.id IN (100, 99, 104) | ||
|+ | |+ | ||
! align="left" width="200px" | is null | ! align="left" width="200px" | is null | ||
− | | width="200px" | | + | | width="200px" | Attribute is null |
| profile.religion is null | | profile.religion is null | ||
|+ | |+ | ||
! align="left" width="200px" | is not null | ! align="left" width="200px" | is not null | ||
− | | width="200px" | | + | | width="200px" | Attribute is not null |
| profile.religion is not null | | profile.religion is not null | ||
|} | |} | ||
Line 86: | Line 86: | ||
== Namespaces == | == Namespaces == | ||
− | + | The fields can be specified in the "namespace.field_name" standard. We have the following namespaces and fields: | |
− | + | ||
− | + | ||
=== person === | === person === | ||
{| | {| | ||
− | ! align="left" width="200px" | | + | ! align="left" width="200px" | Field |
− | ! align="left" width="400px" | | + | ! align="left" width="400px" | Description |
|+ | |+ | ||
| person.id | | person.id | ||
− | | | + | | Identification number |
|+ | |+ | ||
| person.email | | person.email | ||
− | | Email | + | | Email address |
|+ | |+ | ||
| person.created | | person.created | ||
− | | | + | | Creation date/time |
|+ | |+ | ||
| person.updated | | person.updated | ||
− | | | + | | Date/time of the last update |
|} | |} | ||
Line 112: | Line 110: | ||
{| | {| | ||
− | ! align="left" width="200px" | | + | ! align="left" width="200px" | Field |
− | ! align="left" width="400px" | | + | ! align="left" width="400px" | Description |
|+ | |+ | ||
| profile.display_name | | profile.display_name | ||
− | | | + | | Display name |
|+ | |+ | ||
| profile.name.formatted | | profile.name.formatted | ||
− | | | + | | Full name |
|+ | |+ | ||
| profile.name.family_name | | profile.name.family_name | ||
− | | | + | | Last name |
|+ | |+ | ||
| profile.name.middle_name | | profile.name.middle_name | ||
− | | | + | | Middle name |
|+ | |+ | ||
| profile.name.given_name | | profile.name.given_name | ||
− | | | + | | First name |
|+ | |+ | ||
| profile.name.honorific_prefix | | profile.name.honorific_prefix | ||
− | | | + | | Honorific (prefix) |
|+ | |+ | ||
| profile.name.honorific_suffix | | profile.name.honorific_suffix | ||
− | | | + | | Honorific (suffix) |
|+ | |+ | ||
| profile.nickname | | profile.nickname | ||
− | | | + | | Nickname |
|+ | |+ | ||
| profile.updated | | profile.updated | ||
− | | | + | | Date/time of the last update |
|+ | |+ | ||
| profile.birthday | | profile.birthday | ||
− | | | + | | Birthday |
|+ | |+ | ||
| profile.gender | | profile.gender | ||
− | | | + | | Gender |
|+ | |+ | ||
| profile.preferred_username | | profile.preferred_username | ||
− | | | + | | Preferred username |
|+ | |+ | ||
| profile.utf_offset | | profile.utf_offset | ||
− | | | + | | UTC offset |
|+ | |+ | ||
| profile.about_me | | profile.about_me | ||
− | | | + | | About me |
|+ | |+ | ||
| profile.current_location | | profile.current_location | ||
− | | | + | | Current location |
|+ | |+ | ||
| profile.religion | | profile.religion | ||
− | | | + | | Religion |
|+ | |+ | ||
| profile.status | | profile.status | ||
− | | | + | | Last Twitter status, if available |
|+ | |+ | ||
| profile.emails.value | | profile.emails.value | ||
Line 328: | Line 326: | ||
=== custom === | === custom === | ||
− | + | The custom fields that can be used for search depend on the custom fields created on Webforms. Each marketing account has its own collection of custom fields. To search on these fields you can simply create rules using "custom.field_name". | |
− | + | ||
− | + |
Revision as of 12:28, 4 November 2014
The standard used in contact search is "SQL-like": the syntax is very similar with what we use to query relational databases. Some examples:
SQL | People Search API | select * from profile where profile.gender = 'male' | profile.gender = 'male' | select * from profile where profile.gender = 'male' or profile.religion = 'Atheist' | profile.gender = 'male' or profile.religion = 'Atheist' |
---|
Contents |
Logical Operators
Code | Operation | Example | and | Conjunction | profile.name.formatted = 'Guilherme Silva' and profile.gender = 'male' | or | Disjunction | profile.name.formatted = 'Guilherme Silva' or profile.gender = 'male' | not | Negation | not profile.gender = 'male' |
---|
Relational Operators
Code | Operation | Example | = | Equality | profile.name.formatted = 'Guilherme Silva' | != | Difference | profile.name.formatted = 'Guilherme Silva' | < | Lesser than | profile.id < 100 | > | Greater than | profile.id > 100 | <= | Lesser than or equals | profile.id <= 100 | >= | Greater than or equals | profile.id >= 100 | like | "like" operator | profile.name.given_name like 'Guilher%' | between | Between :A and :B | profile.id between 1 and 3 | in | "in" operator | profile.id IN (100, 99, 104) | is null | Attribute is null | profile.religion is null | is not null | Attribute is not null | profile.religion is not null |
---|
Namespaces
The fields can be specified in the "namespace.field_name" standard. We have the following namespaces and fields:
person
Field | Description | person.id | Identification number | person.email | Email address | person.created | Creation date/time | person.updated | Date/time of the last update |
---|
profile
Field | Description | profile.display_name | Display name | profile.name.formatted | Full name | profile.name.family_name | Last name | profile.name.middle_name | Middle name | profile.name.given_name | First name | profile.name.honorific_prefix | Honorific (prefix) | profile.name.honorific_suffix | Honorific (suffix) | profile.nickname | Nickname | profile.updated | Date/time of the last update | profile.birthday | Birthday | profile.gender | Gender | profile.preferred_username | Preferred username | profile.utf_offset | UTC offset | profile.about_me | About me | profile.current_location | Current location | profile.religion | Religion | profile.status | Last Twitter status, if available | profile.emails.value | profile.emails.type | profile.emails.primary | profile.urls.value | profile.urls.type | profile.urls.primary | profile.phone_numbers.value | profile.phone_numbers.type | profile.ims.value | profile.ims.type | profile.languages_spoken.name | profile.languages_spoken.level | profile.addresses.formatted | profile.addresses.street_address | profile.addresses.locality | profile.addresses.region | profile.addresses.postal_code | profile.addresses.country | profile.organizations.name | profile.organizations.department | profile.organizations.title | profile.organizations.type | profile.organizations.start_date | profile.organizations.end_date | profile.organizations.location | profile.organizations.description | profile.organizations.primary | profile.educations.name | profile.educations.type | profile.educations.start_date | profile.educations.end_date | profile.educations.description | profile.educations.degree | profile.interests.name | profile.interests.category | profile.interests.link | profile.likes.name | profile.likes.category | profile.likes.link | profile.political_views | profile.picture_url | profile.profile_url | profile.locale | profile.verified_account | profile.verified_email | profile.hometown | profile.interested_in_meeting | profile.quotes | profile.significant_other | profile.industry | profile.professional_headline | profile.specialties | profile.honors |
---|
custom
The custom fields that can be used for search depend on the custom fields created on Webforms. Each marketing account has its own collection of custom fields. To search on these fields you can simply create rules using "custom.field_name".