Search Filters

(Difference between revisions)
Jump to: navigation, search
(Relational Operators)
Line 1: Line 1:
O padrão utilizado na [[POST database/people/search|busca de contatos]] é "SQL-like", ou seja, a sintaxe é muito parecida com o que usamos para consultas em bancos de dados relacionais. Alguns exemplos de queries:
+
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" | Código
+
! align="left" width="200px" | Code
! align="left" width="200px" | Operação
+
! align="left" width="200px" | Operation
! align="left" | Exemplo
+
! align="left" | Example
 
|+
 
|+
 
! align="left" width="200px" | and
 
! align="left" width="200px" | and
| width="200px" | Conjunção
+
| 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" | Disjunção
+
| 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" | Negação
+
| width="200px" | Negation
 
| not profile.gender = 'male'
 
| not profile.gender = 'male'
 
|}
 
|}
Line 35: Line 35:
  
 
{|
 
{|
! align="left" width="200px" | Código
+
! align="left" width="200px" | Code
! align="left" width="200px" | Operação
+
! align="left" width="200px" | Operation
! align="left" | Exemplo
+
! align="left" | Example
 
|+
 
|+
 
! align="left" width="200px" | =
 
! align="left" width="200px" | =
| width="200px" | Igualdade
+
| width="200px" | Equality
 
| profile.name.formatted = 'Guilherme Silva'
 
| profile.name.formatted = 'Guilherme Silva'
 
|+
 
|+
 
! align="left" width="200px" | !=
 
! align="left" width="200px" | !=
| width="200px" | Diferença
+
| width="200px" | Difference
 
| profile.name.formatted = 'Guilherme Silva'
 
| profile.name.formatted = 'Guilherme Silva'
 
|+
 
|+
 
! align="left" width="200px" | <
 
! align="left" width="200px" | <
| width="200px" | Menor que
+
| width="200px" | Lesser than
 
| profile.id < 100
 
| profile.id < 100
 
|+
 
|+
 
! align="left" width="200px" | >
 
! align="left" width="200px" | >
| width="200px" | Maior que
+
| width="200px" | Greater than
 
| profile.id > 100
 
| profile.id > 100
 
|+
 
|+
 
! align="left" width="200px" | <=
 
! align="left" width="200px" | <=
| width="200px" | Menor ou igual
+
| width="200px" | Lesser than or equals
 
| profile.id <= 100
 
| profile.id <= 100
 
|+
 
|+
 
! align="left" width="200px" | >=
 
! align="left" width="200px" | >=
| width="200px" | Maior ou igual
+
| width="200px" | Greater than or equals
 
| profile.id >= 100
 
| profile.id >= 100
 
|+
 
|+
 
! align="left" width="200px" | like
 
! align="left" width="200px" | like
| width="200px" | Operador "like"
+
| 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" | Entre :A e :B
+
| 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" | Operador "in"
+
| 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" | Atributo é nulo
+
| 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" | Atributo não é nulo
+
| width="200px" | Attribute is not null
 
| profile.religion is not null
 
| profile.religion is not null
 
|}
 
|}
Line 86: Line 86:
 
== Namespaces ==
 
== Namespaces ==
  
Os campos a serem buscados podem ser especificados no padrão "namespace.fieldname".
+
The fields can be specified in the "namespace.field_name" standard. We have the following namespaces and fields:
 
+
Temos disponíveis os seguintes namespaces e campos:
+
  
 
=== person ===
 
=== person ===
  
 
{|
 
{|
! align="left" width="200px" | Campo
+
! align="left" width="200px" | Field
! align="left" width="400px" | Explicação
+
! align="left" width="400px" | Description
 
|+
 
|+
 
| person.id
 
| person.id
| Número de identificação
+
| Identification number
 
|+
 
|+
 
| person.email
 
| person.email
| Email
+
| Email address
 
|+
 
|+
 
| person.created
 
| person.created
| Data de criação
+
| Creation date/time
 
|+
 
|+
 
| person.updated
 
| person.updated
| Data de última atualização
+
| Date/time of the last update
 
|}
 
|}
  
Line 112: Line 110:
  
 
{|
 
{|
! align="left" width="200px" | Campo
+
! align="left" width="200px" | Field
! align="left" width="400px" | Explicação
+
! align="left" width="400px" | Description
 
|+
 
|+
 
| profile.display_name
 
| profile.display_name
| Nome de Exibição
+
| Display name
 
|+
 
|+
 
| profile.name.formatted
 
| profile.name.formatted
| Nome completo
+
| Full name
 
|+
 
|+
 
| profile.name.family_name
 
| profile.name.family_name
| Sobrenome
+
| Last name
 
|+
 
|+
 
| profile.name.middle_name
 
| profile.name.middle_name
| Nome do Meio
+
| Middle name
 
|+
 
|+
 
| profile.name.given_name
 
| profile.name.given_name
| Primeiro Nome
+
| First name
 
|+
 
|+
 
| profile.name.honorific_prefix
 
| profile.name.honorific_prefix
| Honorífico (prefixo)
+
| Honorific (prefix)
 
|+
 
|+
 
| profile.name.honorific_suffix
 
| profile.name.honorific_suffix
| Honorífico (sufixo)
+
| Honorific (suffix)
 
|+
 
|+
 
| profile.nickname
 
| profile.nickname
| Apelido
+
| Nickname
 
|+
 
|+
 
| profile.updated
 
| profile.updated
| Data da Última Atualização
+
| Date/time of the last update
 
|+
 
|+
 
| profile.birthday
 
| profile.birthday
| Aniversário
+
| Birthday
 
|+
 
|+
 
| profile.gender
 
| profile.gender
| Sexo
+
| Gender
 
|+
 
|+
 
| profile.preferred_username
 
| profile.preferred_username
| Nome de Usuário Escolhido
+
| Preferred username
 
|+
 
|+
 
| profile.utf_offset
 
| profile.utf_offset
| Fuso Horário UTC
+
| UTC offset
 
|+
 
|+
 
| profile.about_me
 
| profile.about_me
| Sobre Mim
+
| About me
 
|+
 
|+
 
| profile.current_location
 
| profile.current_location
| Localização Atual
+
| Current location
 
|+
 
|+
 
| profile.religion
 
| profile.religion
| Religião
+
| Religion
 
|+
 
|+
 
| profile.status
 
| profile.status
| Último status do Twitter do contato, se disponível
+
| Last Twitter status, if available
 
|+
 
|+
 
| profile.emails.value
 
| profile.emails.value
Line 328: Line 326:
 
=== custom ===
 
=== custom ===
  
Os campos custom dependem dos campos customizados criados nos webforms. Cada Conta de Marketing tem seu próprio conjunto de campos 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".
 
+
Para filtrar pelos campos custom basta criar regras com "custom.nome_do_campo".
+

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".

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox