חיפוש משאבים ב-Knowledge Catalog

‫Knowledge Catalog (לשעבר Dataplex Universal Catalog) מספק תכונת חיפוש עוצמתית שמאפשרת לכם למצוא ולנהל נכסי נתונים בארגון באמצעות חוויית גילוי מאוחדת. Knowledge Catalog משתמש בחיפוש בשפה טבעית שמבוסס על AI, כך שאתם יכולים לשאול שאלות בשפה פשוטה כדי למצוא את הנתונים שאתם צריכים.

ב-Knowledge Catalog יש שני מצבי חיפוש:

  • חיפוש מילות מפתח מאפשר לכם למצוא מקורות מידע באמצעות מילות מפתח ספציפיות, מסננים ותחביר מוגדר.
  • חיפוש בשפה טבעית מתבסס על AI כדי לתמוך בשאילתות חיפוש סמנטי. הוא מאפשר לכם למצוא משאבים באמצעות שפה יומיומית, בלי שתצטרכו להשתמש בתחביר מורכב.

אתם יכולים להשתמש בסוכן הגילוי של Knowledge Catalog כדי לקבל תשובות לשאילתות מורכבות בשפה טבעית. מידע נוסף זמין במאמר יצירת סוכן לחיפוש נתונים.

תרחישים לדוגמה

תכונת החיפוש ב-Knowledge Catalog מציעה את החוויות הבאות לארגונים ולבעלי עניין שונים:

  • גילוי נתונים בשירות עצמי: מאפשר לצוותי ניתוח וצוותי מדעי נתונים למצוא במהירות נתונים רלוונטיים, להבין אותם ולסמוך עליהם לצורך יצירת לוחות בקרה של BI, מודלים של למידת מכונה ואפליקציות של AI גנרטיבי. לדוגמה, חברה קמעונאית יכולה לאתר במהירות את כל מערכי הנתונים שקשורים להתנהגות הלקוחות כדי לבנות מנוע המלצות.
  • משילות ותאימות מרכזיות: מאפשרות לאחראים על הנתונים לנהל מטא-נתונים, לסווג נתונים רגישים ולעקוב אחר הגישה במקום אחד. התכונה הזו עוזרת למוסדות פיננסיים לעמוד בדרישות מחמירות של דיווח רגולטורי, כי היא מאפשרת לשמור על שושלת נתונים ברורה לצורך ניתוח סיכונים.
  • שקיפות נתונים בכל הארגון: אפשר לפרק את סילו הנתונים באמצעות קטלוג יחיד לכל הנתונים, בין אם הם נמצאים ב-BigQuery, ב-Cloud SQL, ב-Cloud Storage או במערכות מקומיות. כך ארגוני בריאות יכולים ליצור תצוגה מאוחדת של נתוני מטופלים כדי לקבל תובנות קליניות טובות יותר.

איך זה עובד

‫Knowledge Catalog יוצר אינדקס אוטומטי של מטא-נתונים ממקורות נתונים משולבים של Google Cloud כמו BigQuery ו-Cloud SQL, ומספק מחברים להטמעת מטא-נתונים ממערכות אחרות, וכך יוצר קטלוג מקיף בכל הארגון. אפשר לחשוב על זה כמו על קטלוג חכם של ספרייה שכולל את כל הנתונים שלכם: אתם יכולים לחפש נכסי נתונים באמצעות חיפוש מילות מפתח עם מסננים מפורטים, או באמצעות שאלות בשפה טבעית, כמו show me tables with revenue data. חיפוש מבוסס-AI מאפשר לכם למצוא בקלות את הקבצים, הטבלאות ומערכי הנתונים הכי רלוונטיים לכם, כי הוא מבין את הכוונה שלכם. התכונה הזו מספקת פרטים טכניים מקיפים והקשר עסקי כדי לוודא שתמצאו בדיוק את מה שאתם צריכים.

טווח החיפוש

תוצאות החיפוש ב-Knowledge Catalog מכבדות את ההרשאות שיש לכם לגבי המשאבים התואמים במערכות המקור.

לדוגמה, אם יש לכם גישת קריאה למטא-נתונים של BigQuery לאובייקט מסוים, האובייקט הזה יופיע בתוצאות החיפוש של Knowledge Catalog. אם יש לכם גישה לטבלה ב-BigQuery אבל לא למערך הנתונים שמכיל את הטבלה הזו, הטבלה עדיין תופיע בחיפוש ב-Knowledge Catalog כמו שציפיתם.

כברירת מחדל, החיפוש מוגבל לארגון שלכם. התוצאות כוללות רק משאבים מאותו ארגון של הפרויקט שבו אתם מחפשים.

תוצאות החיפוש כוללות רק את המשאבים ששייכים לאותו גבול גזרה של VPC Service Controls כמו הפרויקט שבו מתבצע החיפוש. כשמשתמשים במסוףGoogle Cloud , זהו הפרויקט שנבחר במסוף.

כדי להרחיב את היקף תוצאות החיפוש מעבר למשאבים ב-service perimeter של VPC Service Controls בפרויקט, אפשר להשתמש בכללי תעבורת נתונים נכנסת (ingress) ויוצאת (egress) של VPC Service Controls. הכללים האלה מאפשרים להחליף נתונים באופן פרטי ויעיל בארגון. אפשר להגדיר כללי תעבורת נתונים נכנסת (ingress) ותעבורת נתונים יוצאת (egress) באמצעות מסוףGoogle Cloud או באמצעות קובצי JSON או YAML. כדאי לעיין בדוגמה הבאה של YAML ובמסמכי התיעוד של VPC Service Controls כדי להתאים את הכלל לדרישות הספציפיות שלכם.

egressPolicies:
  - egressFrom:
      identityType: ANY_USER_ACCOUNT
    egressTo:
      # Specify which resources should be present in the search results. In this example,
      # BigQuery.
      operations:
      - methodSelectors:
        - method: '*'
        serviceName: bigquery.googleapis.com
      # Specify project ids under which the search is performed.
      resources:
      - projects/SEARCH_PROJECT_ID
ingressPolicies:
  - ingressFrom:
      identityType: ANY_USER_ACCOUNT
      sources:
      - accessLevel: '*'
    ingressTo:
      # Specify which resources should be present in the search results. In this example,
      # BigQuery.
      operations:
      - methodSelectors:
        - method: '*'
        serviceName: bigquery.googleapis.com
      # Specify project ids to expose in search results.
      resources:
      - projects/INGRESS_PROJECT_ID

במאמר תפקידי IAM ב-Knowledge Catalog מוסבר אילו תפקידים בניהול הזהויות והרשאות הגישה (IAM) צריך להשתמש כדי לחפש ב-Knowledge Catalog.

בידוד תוצאות החיפוש לפי סביבה באמצעות VPC Service Controls

כדי לבודד את תוצאות החיפוש ב-Knowledge Catalog בין סביבות כמו פיתוח, בדיקה וייצור, צריך להגדיר היקפים נפרדים של VPC Service Controls לכל סביבה. מקצים את הפרויקטים שמכילים את נכסי הנתונים ואת הפרויקטים שמשמשים לביצוע חיפושים לגבולות הגזרה של הסביבה המתאימה. חיפושים שמבוצעים מפרויקט בתוך היקף מסוים יחזירו רק תוצאות של נכסים שנמצאים גם הם באותו היקף.

מגבלות על ביטול שליחה בחיפוש

שאילתות חיפוש ב-Knowledge Catalog לא מבטיחות היזכרות מלאה. יכול להיות שלא יוחזרו תוצאות שתואמות לשאילתה. בנוסף, אם חוזרים על שאילתות חיפוש, יכול להיות שיהיו הבדלים בתוצאות שמתקבלות (או לא מתקבלות).

כדי לשלוח שאילתה לכל המטא-נתונים של Knowledge Catalog, אפשר לייצא את המטא-נתונים ל-Cloud Storage ואז לשלוח שאילתה מ-BigQuery. מידע נוסף זמין במאמר בנושא ייצוא מטא-נתונים.

מסננים

בעזרת מסננים אפשר לצמצם את תוצאות החיפוש. המסננים זמינים גם בחיפוש לפי מילות מפתח וגם בחיפוש בשפה טבעית, אבל האפשרויות הזמינות עשויות להיות שונות מעט בהתאם למצב.

כשמספקים מסננים בכמה קטעים, המערכת מעריכה אותם באמצעות האופרטור הלוגי AND. תוצאות החיפוש מכילות מקורות מידע שתואמים לפחות לתנאי אחד מכל אחד מהקטעים שנבחרו. לדוגמה, אם בוחרים במערכת BigQuery ובסוג המשאב dataset, תוצאות החיפוש יכללו מערכי נתונים של BigQuery אבל לא מערכי נתונים של Vertex AI.

אם בוחרים כמה מסננים בקטע אחד, המערכת מבצעת הערכה שלהם באמצעות האופרטור הלוגי OR. לדוגמה, אם בוחרים את סוג המשאב dataset ואת סוג המשאב table, תוצאות החיפוש יכללו גם מערכי נתונים וגם טבלאות.

מסנני חיפוש של מילות מפתח

בחיפוש מילות מפתח, המסננים מחולקים לקטעים הבאים:

  • מערכות כמו BigQuery,‏ Cloud SQL ועוד. מערכת Knowledge Catalog מכילה רשומות מותאמות אישית.
  • היבטים (תגים): רשימה של כל ההיבטים שזמינים לכם.
  • פרויקט: רשימה של כל הפרויקטים שזמינים לכם.
  • כינויי סוגים מתארים סוגי משאבים, כמו מסדי נתונים, מערכי נתונים, מודלים, טבלאות, תצוגות, שירותים וסוגים בהתאמה אישית.
  • מערכי נתונים מגיעים מ-BigQuery.

סינון לפי ערך היבט

המסננים Aspects מאפשרים לכם לחפש נכסים שתויגו באמצעות תבנית ספציפית. אפשר להשתמש בתפריט התאמה אישית כדי לצמצם עוד יותר את התוצאות ולסנן לפי ערכים ספציפיים של היבטים. תנאי הסינון של ערך ההיבט תלויים בסוג הנתונים של שדה ההיבט. לדוגמה, בשדות datetime ו-number אפשר לציין תאריך מסוים או טווח תאריכים.

סינון לפי סטטוס החשיפה

המסננים Systems,‏ Type aliases,‏ Project ו-Datasets מוצגים בהתאם לשאילתה הנוכחית בשדה Search.

מסנני חיפוש בשפה טבעית

לחיפוש בשפה טבעית, המסננים הבאים זמינים:

  • Scope: חיפוש בכל הארגון (ברירת מחדל), בפרויקט הנוכחי או רק במשאבים המסומנים בכוכב. מידע נוסף מופיע בקטע היקף החיפוש במסמך הזה.
  • Systems: Google Cloud השירות שאליו משתייך המשאב, כמו BigQuery. מערכת Knowledge Catalog מכילה קבוצות של רשומות.
  • Projects: הפרויקטים שבהם יתבצע החיפוש.
  • סוג: סוג המשאב, כמו חיבור ל-BigQuery, קטגוריה של Cloud Storage או מסד נתונים. בהתאם לסוג המשאב, אפשר גם לסנן לפי סוג משנה, כמו סוג החיבור או ניב SQL.
  • בחירת מיקומים: המיקומים שבהם יתבצע החיפוש.
  • בחירת מערכי נתונים: תוצאות החיפוש מוגבלות למשאבי BigQuery ששייכים למערכי הנתונים שנבחרו ב-BigQuery. בשדה Type to filter (הקלדה לסינון), מזינים את השם של מערך הנתונים.
  • סוגי היבטים: סוגי ההיבטים ב-Knowledge Catalog שמשויכים למשאב שאתם מחפשים. כדי לסנן לפי ערכי היבטים, לוחצים על סינון לפי ערכי הערות ואז בוחרים את הערכים.

לפני שמתחילים

לפני שמבצעים חיפוש, צריך לוודא שהוקצו לכם התפקידים הנדרשים ושהפעלתם את ה-API הדרוש.

התפקידים הנדרשים

בקטע הזה מתוארים התפקידים וההרשאות שנדרשים כדי לחפש משאבים ולגשת לתוצאות החיפוש.

מידע נוסף על מתן תפקידים מופיע במאמר ניהול הגישה.

יכול להיות שתוכלו לקבל את ההרשאות הנדרשות גם באמצעות תפקידים בהתאמה אישית או תפקידים מוגדרים מראש אחרים.

התפקידים שנדרשים כדי לחפש רשומות

כדי לחפש רשומות, צריך לפחות אחד מתפקידי ה-IAM הבאים בפרויקט שמשמש לחיפוש: Dataplex Catalog Admin,‏ Dataplex Catalog Editor או Dataplex Catalog Viewer. ההרשאות בתוצאות החיפוש נבדקות בנפרד מהפרויקט שנבחר.

התפקידים שנדרשים כדי לגשת לתוצאות החיפוש

תוצאות החיפוש ב-Knowledge Catalog מוגבלות בהתאם לתפקיד שלכם. כדי לחפש נכס ב-Knowledge Catalog, צריכות להיות לכם הרשאות גישה למשאב המתאים במערכת המקור. מידע נוסף מופיע בקטע היקף החיפוש במאמר הזה.

לדוגמה, כדי לחפש מערכי נתונים, טבלאות, תצוגות ומודלים של BigQuery, אתם צריכים את ההרשאות המתאימות לערכים האלה. מידע נוסף זמין במאמר הרשאות ב-BigQuery.

הרשימה הבאה מתארת את ההרשאות המינימליות הנדרשות:

  • כדי לחפש טבלה, צריך הרשאה bigquery.tables.get לטבלה הזו.
  • כדי לחפש מערך נתונים, צריך הרשאת bigquery.datasets.get למערך הנתונים הזה.
  • כדי לחפש מטא-נתונים של מערך נתונים או טבלה, צריך את התפקיד BigQuery Metadata Viewer (צפייה במטא-נתונים של BigQuery) (roles/bigquery.metadataViewer).

דוגמה נוספת: כדי לחפש מכונות, מסדי נתונים, סכימות, טבלאות ותצוגות ב-Cloud SQL, צריך הרשאות מתאימות לערכים האלה. מידע נוסף זמין במאמר תפקידים והרשאות ב-Cloud SQL.

כדי לחפש רשומות בהתאמה אישית, צריך את התפקיד Dataplex Catalog Viewer (צפייה בקטלוג Dataplex) ‏(roles/dataplex.catalogViewer).

הפעלת ה-API

מפעילים את Dataplex API.

תפקידים שנדרשים להפעלת ממשקי API

כדי להפעיל ממשקי API, נדרשת ההרשאה serviceusage.services.enable. אם יצרתם את הפרויקט, סביר להניח שכבר יש לכם את ההרשאה הזו דרך התפקיד 'בעלים' (roles/owner). אחרת, תוכלו לקבל את ההרשאה הזו דרך התפקיד 'אדמין בממשק 'שימוש בשירות'' (roles/serviceusage.serviceUsageAdmin). איך מקצים תפקידים

להפעלת ה-API

חיפוש מקורות מידע

‫* {Console}

כדי לחפש משאבים, פועלים לפי השלבים הבאים:

  1. נכנסים לדף Search של Knowledge Catalog במסוף Google Cloud .

    מעבר אל חיפוש

  2. אם פלטפורמת החיפוש מוגדרת לקטלוג נתונים, בתפריט בחירת פלטפורמת חיפוש בוחרים באפשרות Knowledge Catalog.

    אם בוחרים באפשרות Knowledge Catalog, אפשר לחפש במאגר המטא-נתונים של Knowledge Catalog. אם אתם משתמשים קיימים ב-Data Catalog, תוכלו לבחור באפשרות Data Catalog כדי לחפש במאגר של Data Catalog.

  3. כדי להשתמש בחיפוש מילות מפתח, פועלים לפי השלבים הבאים:

    1. בשדה Find resources across projects (חיפוש משאבים בכל הפרויקטים), מזינים את השאילתה.

    2. כדי לצמצם את החיפוש, משתמשים בחלונית Filters. רשימת המסננים הזמינים מופיעה במאמר מסננים לחיפוש לפי מילות מפתח.

      אפשר להוסיף באופן ידני את המסננים הבאים:

      • כדי להוסיף מסנן פרויקט: בקטע פרויקט, לוחצים על הוספת פרויקט. מחפשים פרויקט ספציפי, בוחרים אותו ולוחצים על Open.
      • כדי להוסיף מסנן של סוג היבט: בקטע היבטים, לוחצים על התפריט הוספת סוגי היבטים נוספים. מחפשים תבנית ספציפית, בוחרים אותה ולוחצים על אישור.
    3. אופציונלי: בנוסף לנכסים שזמינים לכם, אתם יכולים לחפש משאבים שזמינים לכולם ב Google Cloud על ידי בחירה באפשרות Include public datasets (הכללת מערכי נתונים ציבוריים).

      הטיפים הבאים יעזרו לכם ליצור שאילתת חיפוש:

      • אם הביטוי לחיפוש מכיל רווחים, צריך להקיף אותו במירכאות. לדוגמה, "search terms".
      • מוסיפים NOT לפני מילת מפתח כדי להתאים לשלילה הלוגית של המסנן keyword:term. אפשר גם להשתמש באופרטורים בוליאניים AND ו-OR כדי לשלב ביטויי חיפוש. האופרטורים AND,‏ OR ו-NOT לא תלויי אותיות רישיות (case-sensitive).

        לדוגמה, הפקודה NOT column:term מפרטת את כל העמודות חוץ מאלה שתואמות למונח שצוין. רשימה של מילות מפתח ומונחים אחרים שאפשר להשתמש בהם בביטוי חיפוש ב-Knowledge Catalog מופיעה במאמר בנושא תחביר חיפוש.

  4. כדי להשתמש בחיפוש בשפה טבעית, פועלים לפי השלבים הבאים:

    1. לוחצים על חיפוש בשפה טבעית.

    2. בשדה חיפוש משאבים בכל הפרויקטים באמצעות שפה טבעית, מזינים את השאילתה בשפה טבעית ומקישים על Enter.

      הנה כמה שאילתות לדוגמה:

      • Show me the datasets that contain taxi information
      • Find data on vaccine distribution across different countries
      • Get tables with historical temperature data for major world cities
      • Search for hurricane tracking and storm activity datasets
      • Population data by country
    3. כדי לצמצם את החיפוש, לוחצים על מסננים. רשימת המסננים הזמינים מופיעה במאמר מסננים לחיפוש בשפה טבעית.

  5. כדי לראות מידע נוסף על המשאב שחיפשתם, לוחצים על שם המשאב בתוצאות החיפוש. ייפתח דף הפרטים של הרשומה.

gcloud

כדי לחפש משאבים, משתמשים בפקודה gcloud dataplex entries search.

C#‎

C#

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי C#ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog C# API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

using Google.Api.Gax;
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Dataplex.V1;
using System;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for SearchEntries</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void SearchEntriesRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        SearchEntriesRequest request = new SearchEntriesRequest
        {
            LocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            Query = "",
            OrderBy = "",
            Scope = "",
            SemanticSearch = false,
        };
        // Make the request
        PagedEnumerable<SearchEntriesResponse, SearchEntriesResult> response = catalogServiceClient.SearchEntries(request);

        // Iterate over all response items, lazily performing RPCs as required
        foreach (SearchEntriesResult item in response)
        {
            // Do something with each item
            Console.WriteLine(item);
        }

        // Or iterate over pages (of server-defined size), performing one RPC per page
        foreach (SearchEntriesResponse page in response.AsRawResponses())
        {
            // Do something with each page of items
            Console.WriteLine("A page of results:");
            foreach (SearchEntriesResult item in page)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
        }

        // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
        int pageSize = 10;
        Page<SearchEntriesResult> singlePage = response.ReadPage(pageSize);
        // Do something with the page of items
        Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
        foreach (SearchEntriesResult item in singlePage)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
        // Store the pageToken, for when the next page is required.
        string nextPageToken = singlePage.NextPageToken;
    }
}

המשך

Go

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Goההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Go API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.


//go:build examples

package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.SearchEntriesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#SearchEntriesRequest.
	}
	it := c.SearchEntries(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*dataplexpb.SearchEntriesResponse)
	}
}

Java

Java

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.LocationName;
import com.google.cloud.dataplex.v1.SearchEntriesRequest;
import com.google.cloud.dataplex.v1.SearchEntriesResult;

public class SyncSearchEntries {

  public static void main(String[] args) throws Exception {
    syncSearchEntries();
  }

  public static void syncSearchEntries() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      SearchEntriesRequest request =
          SearchEntriesRequest.newBuilder()
              .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setQuery("query107944136")
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setOrderBy("orderBy-1207110587")
              .setScope("scope109264468")
              .setSemanticSearch(true)
              .build();
      for (SearchEntriesResult element : catalogServiceClient.searchEntries(request).iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}

Node.js

Node.js

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Node.jsההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Node.js API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. The project to which the request should be attributed in the
 *  following form: `projects/{project}/locations/global`.
 */
// const name = 'abc123'
/**
 *  Required. The query against which entries in scope should be matched.
 *  The query syntax is defined in Search syntax for Dataplex Universal
 *  Catalog (https://cloud.google.com/dataplex/docs/search-syntax).
 */
// const query = 'abc123'
/**
 *  Optional. Number of results in the search page. If <=0, then defaults
 *  to 10. Max limit for page_size is 1000. Throws an invalid argument for
 *  page_size > 1000.
 */
// const pageSize = 1234
/**
 *  Optional. Page token received from a previous `SearchEntries` call. Provide
 *  this to retrieve the subsequent page.
 */
// const pageToken = 'abc123'
/**
 *  Optional. Specifies the ordering of results.
 *  Supported values are:
 *  * `relevance`
 *  * `last_modified_timestamp`
 *  * `last_modified_timestamp asc`
 */
// const orderBy = 'abc123'
/**
 *  Optional. The scope under which the search should be operating. It must
 *  either be `organizations/<org_id>` or `projects/<project_ref>`. If it is
 *  unspecified, it defaults to the organization where the project provided in
 *  `name` is located.
 */
// const scope = 'abc123'
/**
 *  Optional. Specifies whether the search should understand the meaning and
 *  intent behind the query, rather than just matching keywords.
 */
// const semanticSearch = true

// Imports the Dataplex library
const {CatalogServiceClient} = require('@google-cloud/dataplex').v1;

// Instantiates a client
const dataplexClient = new CatalogServiceClient();

async function callSearchEntries() {
  // Construct request
  const request = {
    name,
    query,
  };

  // Run request
  const iterable = dataplexClient.searchEntriesAsync(request);
  for await (const response of iterable) {
      console.log(response);
  }
}

callSearchEntries();

PHP

PHP

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי PHPההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog PHP API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\SearchEntriesRequest;
use Google\Cloud\Dataplex\V1\SearchEntriesResult;

/**
 * Searches for Entries matching the given query and scope.
 *
 * @param string $formattedName The project to which the request should be attributed in the
 *                              following form: `projects/{project}/locations/global`. Please see
 *                              {@see CatalogServiceClient::locationName()} for help formatting this field.
 * @param string $query         The query against which entries in scope should be matched.
 *                              The query syntax is defined in [Search syntax for Dataplex Universal
 *                              Catalog](https://cloud.google.com/dataplex/docs/search-syntax).
 */
function search_entries_sample(string $formattedName, string $query): void
{
    // Create a client.
    $catalogServiceClient = new CatalogServiceClient();

    // Prepare the request message.
    $request = (new SearchEntriesRequest())
        ->setName($formattedName)
        ->setQuery($query);

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $catalogServiceClient->searchEntries($request);

        /** @var SearchEntriesResult $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CatalogServiceClient::locationName('[PROJECT]', '[LOCATION]');
    $query = '[QUERY]';

    search_entries_sample($formattedName, $query);
}

Python

Python

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Pythonההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Python API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_search_entries():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.SearchEntriesRequest(
        name="name_value",
        query="query_value",
    )

    # Make the request
    page_result = client.search_entries(request=request)

    # Handle the response
    for response in page_result:
        print(response)

Ruby

Ruby

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Rubyההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Ruby API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

require "google/cloud/dataplex/v1"

##
# Snippet for the search_entries call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#search_entries.
#
def search_entries
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::SearchEntriesRequest.new

  # Call the search_entries method.
  result = client.search_entries request

  # The returned object is of type Gapic::PagedEnumerable. You can iterate
  # over elements, and API calls will be issued to fetch pages as needed.
  result.each do |item|
    # Each element is of type ::Google::Cloud::Dataplex::V1::SearchEntriesResult.
    p item
  end
end

REST

כדי לחפש משאבים, משתמשים בשיטה searchEntries.

הצגת פרטים של רשומה

המסוף

משתמשים בחיפוש ב-Knowledge Catalog כדי לראות את הפרטים של רשומה.

  1. חיפוש רשומה ב-Knowledge Catalog.

  2. בתוצאות החיפוש, לוחצים על הרשומה שרוצים לראות את הפרטים שלה.

    ייפתח דף הפרטים של הרשומה. הדף כולל את הקטעים הבאים:

    • פרטי הרשומה: כוללים מידע כמו סוג הרשומה, המערכת, הפלטפורמה, השם המוגדר במלואו, זמן היצירה, זמן השינוי האחרון, התיאור והאחראים.
    • סקירה כללית: סקירה כללית של הערך, אם היא זמינה.
    • מאפיינים: המאפיינים הנדרשים והאופציונליים שהוגדרו לרשומה. מידע נוסף זמין במאמר בנושא קטגוריות של היבטים.

gcloud

כדי לראות את הפרטים של רשומה, משתמשים בפקודה gcloud dataplex entries lookup.

C#‎

C#

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי C#ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog C# API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

using Google.Cloud.Dataplex.V1;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for LookupEntry</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void LookupEntryRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        LookupEntryRequest request = new LookupEntryRequest
        {
            Name = "",
            View = EntryView.Unspecified,
            AspectTypes = { "", },
            Paths = { "", },
            EntryAsEntryName = EntryName.FromProjectLocationEntryGroupEntry("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"),
        };
        // Make the request
        Entry response = catalogServiceClient.LookupEntry(request);
    }
}

המשך

Go

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Goההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Go API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.


//go:build examples

package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.LookupEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#LookupEntryRequest.
	}
	resp, err := c.LookupEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.Entry;
import com.google.cloud.dataplex.v1.EntryName;
import com.google.cloud.dataplex.v1.EntryView;
import com.google.cloud.dataplex.v1.LookupEntryRequest;
import java.util.ArrayList;

public class SyncLookupEntry {

  public static void main(String[] args) throws Exception {
    syncLookupEntry();
  }

  public static void syncLookupEntry() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      LookupEntryRequest request =
          LookupEntryRequest.newBuilder()
              .setName("name3373707")
              .setView(EntryView.forNumber(0))
              .addAllAspectTypes(new ArrayList<String>())
              .addAllPaths(new ArrayList<String>())
              .setEntry(
                  EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
              .build();
      Entry response = catalogServiceClient.lookupEntry(request);
    }
  }
}

Node.js

Node.js

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Node.jsההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Node.js API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. The project to which the request should be attributed in the
 *  following form: `projects/{project}/locations/{location}`.
 */
// const name = 'abc123'
/**
 *  Optional. View to control which parts of an entry the service should
 *  return.
 *  **Please check the limitations on returned aspects in the Entry view
 *  documentation. Amount of returned aspects depends on the selected Entry
 *  View.**
 */
// const view = {}
/**
 *  Optional. Limits the aspects returned to the provided aspect types.
 *  It only works for CUSTOM view.
 */
// const aspectTypes = ['abc','def']
/**
 *  Optional. Limits the aspects returned to those associated with the provided
 *  paths within the Entry. It only works for CUSTOM view.
 */
// const paths = ['abc','def']
/**
 *  Required. The resource name of the Entry:
 *  `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`.
 */
// const entry = 'abc123'

// Imports the Dataplex library
const {CatalogServiceClient} = require('@google-cloud/dataplex').v1;

// Instantiates a client
const dataplexClient = new CatalogServiceClient();

async function callLookupEntry() {
  // Construct request
  const request = {
    name,
    entry,
  };

  // Run request
  const response = await dataplexClient.lookupEntry(request);
  console.log(response);
}

callLookupEntry();

PHP

PHP

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי PHPההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog PHP API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Client\CatalogServiceClient;
use Google\Cloud\Dataplex\V1\Entry;
use Google\Cloud\Dataplex\V1\LookupEntryRequest;

/**
 * Looks up an entry by name using the permission on the source system.
 *
 * @param string $name           The project to which the request should be attributed in the
 *                               following form: `projects/{project}/locations/{location}`.
 * @param string $formattedEntry The resource name of the Entry:
 *                               `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}`. Please see
 *                               {@see CatalogServiceClient::entryName()} for help formatting this field.
 */
function lookup_entry_sample(string $name, string $formattedEntry): void
{
    // Create a client.
    $catalogServiceClient = new CatalogServiceClient();

    // Prepare the request message.
    $request = (new LookupEntryRequest())
        ->setName($name)
        ->setEntry($formattedEntry);

    // Call the API and handle any network failures.
    try {
        /** @var Entry $response */
        $response = $catalogServiceClient->lookupEntry($request);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';
    $formattedEntry = CatalogServiceClient::entryName(
        '[PROJECT]',
        '[LOCATION]',
        '[ENTRY_GROUP]',
        '[ENTRY]'
    );

    lookup_entry_sample($name, $formattedEntry);
}

Python

Python

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Pythonההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Python API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_lookup_entry():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.LookupEntryRequest(
        name="name_value",
        entry="entry_value",
    )

    # Make the request
    response = client.lookup_entry(request=request)

    # Handle the response
    print(response)

Ruby

Ruby

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Rubyההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Ruby API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

require "google/cloud/dataplex/v1"

##
# Snippet for the lookup_entry call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#lookup_entry.
#
def lookup_entry
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::LookupEntryRequest.new

  # Call the lookup_entry method.
  result = client.lookup_entry request

  # The returned object is of type Google::Cloud::Dataplex::V1::Entry.
  p result
end

REST

כדי לראות את הפרטים של רשומה, משתמשים בשיטה lookupEntry.

מגבלות

אלה המגבלות של חיפוש בשפה טבעית:

  • חיפוש בשפה טבעית מותאם לחיפוש ולגילוי של תוצאות, ולכן הוא מחזיר רק קבוצה מצומצמת של התוצאות הרלוונטיות ביותר. יכול להיות שהרשימה לא תכלול את כל הפריטים התואמים, ולכן היא לא מתאימה לעומסי עבודה שתלויים בה, כמו צינורות של תהליכי אוצרות.

  • החיפוש בשפה טבעית מתבסס רק על המטא-נתונים של המשאבים, כולל סכימות, תיאורים והיבטים שמצורפים לרשומות. הוא לא עונה על שאלות לגבי הנתונים בטבלאות (לדוגמה, "מה היה היקף המכירות בחודש שעבר?") או מבצע שאילתות אנליטיות על המטא-נתונים (לדוגמה, "כמה טבלאות יש במערך הנתונים X?").

  • משאבים ציבוריים לא נכללים בחיפוש בשפה טבעית.

  • היבטים שמצורפים לקישורי כניסה לא נכללים בחיפוש בשפה טבעית.

המאמרים הבאים