保留和常見的搜尋運算子
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本文列出 Google Cloud Search 中可用的保留和常見搜尋運算子。保留運算子具有 Google Cloud Search 專用用途,無法在結構定義中使用。常見運算子也適用於其他 Google Workspace 應用程式 (例如 Gmail),但可在結構定義中使用。使用常見運算子時請務必謹慎,因為使用者可能已習慣在其他應用程式中使用這些運算子,如果 Cloud Search 的實作方式不同,可能會造成混淆。
保留的運算子
您無法在結構定義中使用下列任何運算子:
運算子 |
定義 |
source |
找出特定產品或資料來源的內容 |
site |
找出特定網站的內容。 |
inurl |
找出特定網址的內容。 |
contenttype |
找出特定類型的內容,例如文件、試算表、簡報、圖片、資料夾和附件。 |
mimetype |
根據原始 MIME 類型找出內容。 |
type |
找出特定類型的內容,例如文件、試算表、簡報、圖片、資料夾和附件。 |
owner |
找出自己擁有的內容,或他人與您共用的內容。如果是來自第三方存放區的內容,唯一有效值為 owner:me 。如果是 Google Workspace 內容,您也可以使用 owner:身分,其中身分可以是擁有者的姓名、使用者名稱或電子郵件地址。 |
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 的項目。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間: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. |"]]