Search Filters

(Difference between revisions)
Jump to: navigation, search
(profile)
Line 5: Line 5:
 
! align="left" | People Search API
 
! align="left" | People Search API
 
|+
 
|+
| select * from profiles where profiles.gender = 'male'
+
| select * from profile where profile.gender = 'male'
| profiles.gender = 'male'
+
| profile.gender = 'male'
 
|+
 
|+
| select * from profiles where profiles.gender = 'male' or religion = 'Atheist'
+
| select * from profile where profile.gender = 'male' or profile.religion = 'Atheist'
| profiles.gender = 'male' or profiles.religion = 'Atheist'
+
| profile.gender = 'male' or profile.religion = 'Atheist'
 
|}
 
|}
  

Revision as of 20:11, 23 April 2013

O padrão utilizado na busca é "SQL-like", ou seja, a sintaxe é muito parecida com o que usamos para consultas em bancos de dados relacionais. Alguns exemplos de queries:

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'

Operators

Código Operação Exemplo
= Igualdade profiles.name.formatted = 'Guilherme Silva'
 != Diferença profiles.name.formatted = 'Guilherme Silva'
< Menor que profiles.id < 100
> Maior que profiles.id > 100
<= Menor ou igual profiles.id <= 100
>= Maior ou igual profiles.id >= 100
like Operador "like" profiles.name.given_name like 'Guilher%'
between Entre :A e :B profiles.id between 1 and 3
in Operador "in" profiles.id IN (100, 99, 104)
is null Atributo é nulo profiles.religion is null
is not null Atributo não é nulo profiles.religion is not null

Fields

Os campos a serem buscados podem ser especificados no padrão "namespace.fieldname".

Temos disponíveis os seguintes namespaces e campos:

profile

Campo Explicação
profile.display_name Nome de Exibição
profile.name.formatted Nome completo
profile.name.family_name Sobrenome
profile.name.middle_name Nome do Meio
profile.name.given_name Primeiro Nome
profile.name.honorific_prefix Honorífico (prefixo)
profile.name.honorific_suffix Honorífico (sufixo)
profile.nickname Apelido
profile.updated Data da Última Atualização
profile.birthday Aniversário
profile.gender Sexo
profile.preferred_username Nome de Usuário Escolhido
profile.utf_offset Fuso Horário UTC
profile.about_me Sobre Mim
profile.current_location Localização Atual
profile.religion Religião
profile.status Último status do Twitter do contato, se disponível
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox