קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כדי לחפש קבוצה ספציפית של תיקיות אחסון שיתופי, משתמשים בשדה q של מחרוזת השאילתה עם drives.list כדי לסנן את תיקיות האחסון שיוחזרו על ידי שילוב של מונח חיפוש אחד או יותר.
מחרוזת שאילתה מכילה את שלושת החלקים הבאים:
query_term operator values
כאשר:
query_term הוא מונח השאילתה או השדה שרוצים לחפש.
operator מציין את התנאי למונח השאילתה.
values הם הערכים הספציפיים שרוצים להשתמש בהם כדי לסנן את תוצאות החיפוש.
כדי לראות את המונחים והאופרטורים של שאילתות שאפשר להשתמש בהם לסינון תיקיות באחסון השיתופי, אפשר לעיין במאמר מונחים ואופרטורים של שאילתות חיפוש.
לדוגמה, מחרוזת השאילתה הבאה מסננת את החיפוש כך שיוחזרו רק תיקיות אחסון שיתופי עם השם Google Drive API resources.
q: name = 'Google Drive API resources' & useDomainAdminAccess=false
דוגמאות למחרוזות שאילתה
בטבלה הבאה מפורטות דוגמאות לכמה מחרוזות בסיסיות של שאילתות לחיפוש בתיקיות משותפות. הקוד בפועל משתנה בהתאם לספריית הלקוח שבה אתם משתמשים לחיפוש.
בנוסף, צריך להוסיף תווי בריחה (escape) לתווים מיוחדים בשמות הקבצים כדי לוודא שהשאילתה פועלת בצורה תקינה. לדוגמה, אם שם קובץ מכיל גם גרש (') וגם לוכסן הפוך ("\"), צריך להשתמש בלוכסן הפוך כדי לבטל את המשמעות שלהם: name
contains 'quinn\'s paper\\essay'.
מה רוצים לשאול
דוגמה
הגדרה useDomainAdminAccess
תיקיות באחסון שיתופי שנוצרו אחרי 1 ביוני 2017
createdTime > '2017-06-01T12:00:00'
true
תיקיות אחסון שיתופי שמוצגות בתצוגת ברירת המחדל
hidden = false
false
תיקיות אחסון שיתופי עם יותר מחבר אחד
memberCount > 1
true
תיקיות אחסון שיתופי עם המילה 'סודי' בכותרת ו-20 חברים או יותר
name contains 'confidential' and memberCount >= 20
true
תיקיות באחסון השיתופי שהמילה 'סודי' מופיעה בשם שלהן, מתוך כל התיקיות באחסון השיתופי של הארגון
name contains 'confidential' and orgUnitId = 'C03az79cb'
true
תיקיות אחסון שיתופי שהמילה 'סודי' מופיעה בשם שלהן, מתוך כל תיקיות האחסון השיתופי שהמשתמש חבר בהן
name contains 'confidential'
false
תיקיות אחסון שיתופי ללא מארגן שהוקצה
organizerCount = 0
true
תיקיות אחסון שיתופי שלא מכילות את מזהה היחידה הארגונית
orgUnitId != 'C03az79cb'
true
שאילתות עם כמה מונחים באמצעות סוגריים
אפשר להשתמש בסוגריים כדי לקבץ כמה מונחי שאילתה יחד. לדוגמה, כדי לחפש תיקיות אחסון שיתופי שנוצרו אחרי תאריך מסוים ושיש בהן יותר מחמישה מארגנים או יותר מ-20 חברים, משתמשים בשאילתה הבאה:
createdTime > '2019-01-01T12:00:00' and (organizerCount > 5 or
memberCount > 20)
החיפוש הזה יחזיר את כל תיקיות האחסון השיתופי שנוצרו אחרי 1 בינואר 2019, שיש בהן יותר מחמישה בעלי הרשאת ניהול או יותר מ-20 חברים.
ממשק Drive API מעריך את האופרטורים and ו-or משמאל לימין, ולכן אותה שאילתה ללא סוגריים תחזיר:
רק אחסון שיתופי עם יותר מחמישה מארגנים שנוצר אחרי 1 בינואר 2019.
כל תיקיות האחסון השיתופי עם יותר מ-20 חברים, גם אלה שנוצרו לפני 1 בינואר 2019.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-08-29 (שעון UTC)."],[],[],null,["# Search for shared drives\n\nTo search for a specific set of shared drives, use the query string `q` field\nwith [`drives.list`](/workspace/drive/api/reference/rest/v3/drives/list) to filter the drives to\nreturn by combining one or more search terms.\n\nA query string contains the following three parts:\n\n*`query_term operator values`*\n\nWhere:\n\n- *`query_term`* is the query term or field to search upon.\n\n | **Note:** Most query terms require `useDomainAdminAccess=true`. For more information about this flag, see [`drives.list`](/workspace/drive/api/reference/rest/v3/drives/list).\n- *`operator`* specifies the condition for the query term.\n\n- *`values`* are the specific values you want to use to filter your search\n results.\n\nTo view the query terms and operators that you can use to filter shared drives,\nsee [Search query terms and operators](/workspace/drive/api/guides/ref-search-terms#drive-properties).\n\nFor example, the following query string filters the search to only return shared\ndrives with the name \"Google Drive API resources.\" \n\n q: name = 'Google Drive API resources' & useDomainAdminAccess=false\n\nQuery string examples\n---------------------\n\nThe following table lists examples of some basic query strings for shared\ndrives. The actual code differs depending on the client library you use for your\nsearch.\n\nYou must also escape special characters in your file names to make sure the\nquery works correctly. For example, if a filename contains both an apostrophe\n(`'`) and a backslash (`\"\\\"`) character, use a backslash to escape them: `name\ncontains 'quinn\\'s paper\\\\essay'`.\n| **Note:** These examples show the unencoded `q` parameter, where `organizerCount =\n| 0` is encoded as `organizerCount+%3d+0`. Client libraries handle this encoding automatically.\n\n| What you want to query | Example | `useDomainAdminAccess` setting |\n|--------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|--------------------------------|\n| Shared drives created after June 1, 2017 | `createdTime \u003e '2017-06-01T12:00:00'` | `true` |\n| Shared drives visible in the default view | `hidden = false` | `false` |\n| Shared drives with more than one member | `memberCount \u003e 1` | `true` |\n| Shared drives with the word 'confidential' in the title and 20 or more members | `name contains 'confidential' and memberCount \u003e= 20` | `true` |\n| Shared drives with the word 'confidential' in the title among all shared drives of the organization | `name contains 'confidential' and orgUnitId = 'C03az79cb'` | `true` |\n| Shared drives with the word 'confidential' in the title among all shared drives that the user is a member of | `name contains 'confidential'` | `false` |\n| Shared drives with no assigned organizer | `organizerCount = 0` | `true` |\n| Shared drives that don't contain the organizational unit ID | `orgUnitId != 'C03az79cb'` | `true` |\n\nQuery multiple terms with parentheses\n-------------------------------------\n\nYou can use parentheses to group multiple query terms together. For example, to\nsearch for shared drives created after a specific date and that either have more\nthan five organizers or more than 20 members, use this query: \n\n createdTime \u003e '2019-01-01T12:00:00' and (organizerCount \u003e 5 or\n memberCount \u003e 20)\n\nThis search returns all shared drives created after January 1st, 2019 and that\nhave more than five organizers or more than 20 members.\n\nThe Drive API evaluates `and` and `or` operators from left to right,\nso the same search without parentheses would return:\n\n- Only shared drives with more than five organizers that were created after January 1st, 2019.\n- All shared drives with more than 20 members, even those created before January 1st, 2019.\n\nRelated topics\n--------------\n\n- [Search for files and folders](/workspace/drive/api/guides/search-files)\n- [Search query terms and operators](/workspace/drive/api/guides/ref-search-terms)"]]