有什么方法可以使用“或” Google Directory API users.list查询中的操作符? [英] Is there any way to use an "or" operator in Google Directory API users.list query?

查看:84
本文介绍了有什么方法可以使用“或” Google Directory API users.list查询中的操作符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 users.list Google API API 为Google网域用户建立搜寻查询。我试图根据文档构建查询,该查询将选择 开始的所有用户在信件m上。

我写了查询:
givenName:m *或familyName:m * ,但它没有工作。

只有 givenName:m * familyName:m * 可以工作,但它在子句中插入和运算符。

In docs逗留:
$ b


多个子句由空格分隔,并通过和运算符隐式地加入。


我只能用隐式和运算符编写查询吗?有什么办法如何使用?来编写它? 解决方案

API 我发现我真的不'您需要 {{PREFIX}} * 或一些运营商来完成我的目标。



如果您想搜索所有给定或姓氏开始的用户,例如在字母m上,只需在查询参数中放入一个 m (没有字段名称,例如givenName:)。看来,API隐式搜索所有域用户的 givenName familyName 字段。它还搜索所有电子邮件字段的子字符串(例如 martin @ example.com)中的子字符串(@之前)。

在查询中使用单词example,它会为所有用户提供电子邮件字段,如@ example .com。

如果您只放入了一些没有指定字段的字符串,那么API也可能会在其他字段中进行搜索,但我没有找到。



我不知道如果这是一个错误或一个功能,但我知道它部分回答了我的问题。

I want to build a search query for Google domain users using users.list Google Directory API. I tried to build a query according docs, which will select all users with givenName or familyName starts e.g. on letter "m".
I wrote the query: givenName:m* or familyName:m*, but it doesn't work.
Only givenName:m* familyName:m* works but it inserts "and" operator between clauses.
In docs stays:

Multiple clauses are separated by whitespace and are implicitly joined by an "and" operator.

Can I only write a query with the implicit "and" operator? Is there any way how to write it using "or"?

解决方案

After some time experimenting with the API I have found out that I really don't need {{PREFIX}}* or some operators to accomplish my goal.

If you want to search all the users whose given or family name starts e.g. on letter "m", just put a single m (without field name e.g. "givenName:") into the query parameter. It seems that API implicitly searches in all domain users' givenName and familyName fields. It also searches in a substring (before "@") of all email fields (e.g. martin@example.com).

If you put word "example" in the query, it'll gives you all users with email field something@example.com.

It is possible that if you put only some string without any specified fields, the API may also searches in any other field, but I didn't find in which.

I don't know if this is a bug or a feature, but I know it partially gives an answer to my question.

这篇关于有什么方法可以使用“或” Google Directory API users.list查询中的操作符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆