预留和常用搜索运算符
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本文档列出了 Google Cloud Search 中可用的预留和常用搜索运算符。预留运算符具有 Google Cloud Search 特定的用途,不能在架构中使用。通用运算符与其他 Google Workspace 应用(例如 Gmail)通用,但可以在架构中使用。
使用常用运算符时要谨慎,因为熟悉这些运算符在其他应用中的用法的用户可能会对 Cloud Search 中不同的实现方式感到困惑。
预留的运算符
您无法在架构中使用以下任何运算符:
运算符 |
定义 |
source |
查找特定产品或数据源中的内容 |
site |
查找特定网站上的内容。 |
inurl |
查找来自特定网址的内容。 |
contenttype |
查找特定类型的内容,例如文档、电子表格、演示文稿、图片、文件夹和附件。 |
mimetype |
根据原始 MIME 类型查找内容。 |
type |
查找特定类型的内容,例如文档、电子表格、演示文稿、图片、文件夹和附件。 |
owner |
查找您拥有或他人与您共享的内容。对于源自第三方代码库的内容,唯一有效的值是 owner:me 。对于 Google Workspace 内容,您还可以使用 owner:identity,其中 identity 可以是所有者的姓名、用户名或电子邮件地址。 |
from |
查找特定人员发送或创建的内容。此运算符用作 owner 的别名。 |
before |
使用 YYYY/MM/DD 格式查找特定日期之前修改过的内容。 |
after |
使用 YYYY/MM/DD 格式查找特定日期当天或之后修改过的内容。 |
createddatetimestampbefore |
使用 YYYY/MM/DD 格式查找特定日期之前创建的内容。 |
createddatetimestampafter |
使用 YYYY/MM/DD 格式查找特定日期当天或之后创建的内容。 |
itemsize |
查找具有特定大小(以字节为单位)的内容。 |
itemsizelessthan |
查找小于特定大小(以字节为单位)的内容。 |
itemsizegreaterthan |
查找大于或等于特定大小(以字节为单位)的内容。 |
in |
此运算符的用途尚未确定。 |
is |
此运算符的用途尚未确定。 |
has |
此运算符的用途尚未确定。 |
to |
此运算符的用途尚未确定。 |
表中的后四个运算符是预留的,但尚未有具体定义。
如需了解用户如何使用特定运算符,请参阅缩小搜索范围。
常见运算符
您可以在架构中声明以下运算符。为了尽量减少用户困惑,请声明这些运算符,使其用法与下表中的定义保持一致。
运算符 |
使用方数量 |
定义 |
size |
Gmail |
查找大于指定大小(以字节为单位)的项。 |
larger |
Gmail |
查找大于指定大小(以字节为单位)的项。与 size 同义。 |
smaller |
Gmail |
查找小于指定大小(以字节为单位)的项。 |
older_than |
Gmail |
查找早于指定日期的内容。 |
newer_than |
Gmail |
查找晚于指定日期的内容。 |
subject |
Gmail |
查找具有特定主题或标题的内容。 |
label |
Gmail |
查找带有指定标签的内容。 |
list |
Gmail |
查找指定邮寄名单中的内容。 |
cc |
Gmail |
查找 cc 字段中包含指定收件人的商品。 |
bcc |
Gmail |
查找 bcc 字段中包含指定收件人的商品 |
deliveredto |
Gmail |
查找发送到指定电子邮件地址的内容。 |
category |
Gmail |
查找具有指定类别的内容。 |
title |
云端硬盘 |
匹配具有指定标题的商品。 |
app |
云端硬盘 |
搜索只能通过特定应用打开的内容。 |
mailthreadid |
Gmail |
匹配具有指定线程 ID 的商品。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Reserved and common search operators\n\nThis document lists the *reserved* and common search operators available within\nGoogle Cloud Search. *Reserved* operators have Google Cloud Search-specific\nuse and cannot be used in your schema. *Common* operators are common to\nother Google Workspace apps, such as Gmail, but can be used in your schema.\nBe cautious when using common operators, because users who are familiar with\ntheir use in other apps might be confused by a different implementation in\nCloud Search.\n\nReserved operators\n------------------\n\nYou cannot use any of the following operators in your schema:\n\n| Operator | Definition |\n|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `source` | Find content from a particular product or data source |\n| `site` | Find content from a particular site. |\n| `inurl` | Find content from a particular url. |\n| `contenttype` | Find particular types of content, such as documents, spreadsheets, presentations, images, folders, and attachments. |\n| `mimetype` | Finds content based on the original mimetype. |\n| `type` | Find particular types of content, such as documents, spreadsheets, presentations, images, folders, and attachments. |\n| `owner` | Find content you own or that's been shared with you. For content originating from third party repositories, the only valid value is `owner:me`. For Google Workspace content, you can also use owner:*identity* where *identity* can be the owner's name, username, or email address. |\n| `from` | Find content from a specific person who sent or created the content. This operator is used as an alias for `owner`. |\n| `before` | Find content modified before a certain date, using the format YYYY/MM/DD. |\n| `after` | Find content modified on or after a certain date, using the format YYYY/MM/DD. |\n| `createddatetimestampbefore` | Find content created before a certain date, using the format YYYY/MM/DD. |\n| `createddatetimestampafter` | Find content created on or after a certain date, using the format YYYY/MM/DD. |\n| `itemsize` | Find content with a particular size specified in bytes. |\n| `itemsizelessthan` | Find content less than a particular size specified in bytes. |\n| `itemsizegreaterthan` | Find content greater than or equal to a particular size specified in bytes. |\n| `in` | The use of this operator has not been determined. |\n| `is` | The use of this operator has not been determined. |\n| `has` | The use of this operator has not been determined. |\n| `to` | The use of this operator has not been determined. |\n\nThe last four operators in the table are reserved, but do not yet have a\nspecific definition.\n\nFor information on how users use a specific operator, refer to\n[Narrow your search](https://support.google.com/cloudsearch/answer/6172299).\n\nCommon operators\n----------------\n\nYou may declare the following operators in your schema. To minimize user\nconfusion, declare these operators so their usage is consistent with the\ndefinition in the following table.\n\n| Operator | Used by | Definition |\n|----------------|---------|-------------------------------------------------------------------------|\n| `size` | Gmail | Find items larger than the given size in bytes. |\n| `larger` | Gmail | Find items larger than the given size in bytes. Synonymous with `size`. |\n| `smaller` | Gmail | Find items smaller than a given size in bytes. |\n| `older_than` | Gmail | Find items older than a given date. |\n| `newer_than` | Gmail | Find items newer than a given date. |\n| `subject` | Gmail | Find items with a specific subject or title. |\n| `label` | Gmail | Find items with a given label. |\n| `list` | Gmail | Find items from a given mailing list. |\n| `cc` | Gmail | Find items with the given recipient in the `cc` field. |\n| `bcc` | Gmail | Find items with the given recipient in the `bcc` field |\n| `deliveredto` | Gmail | Find items delivered to the given email address. |\n| `category` | Gmail | Find items with a given category. |\n| `title` | Drive | Matches item with a given title. |\n| `app` | Drive | Search for items that can only be opened by a specific app. |\n| `mailthreadid` | Gmail | Matches items with the given thread ID. |"]]