Knowledge Catalog에서 키워드 전용 검색 사용

Knowledge Catalog에서 키워드 전용 검색을 사용하여 특정 키워드, 필터, 정의된 구문을 사용하여 리소스를 찾습니다. 키워드 전용 검색을 사용하면 검색어를 정확하게 제어하고 메타데이터 필드를 기반으로 결과를 좁힐 수 있습니다.

시작하기 전에

검색을 수행하기 전에 필요한 역할이 부여되었고 필요한 API가 사용 설정되어 있는지 확인합니다.

필요한 역할

Knowledge Catalog에서 항목을 검색하고 검색 결과에 액세스하는 데 필요한 권한을 얻으려면 관리자에게 다음 IAM 역할을 부여해 달라고 요청하세요.

역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.

커스텀 역할이나 다른 사전 정의된 역할을 통해 필요한 권한을 얻을 수도 있습니다.

키워드 전용 검색 사용

콘솔

키워드 검색을 사용하여 리소스를 검색하려면 다음 단계를 따르세요.

  1. Google Cloud 콘솔에서 Knowledge Catalog 검색 페이지로 이동합니다.

    검색 페이지로 이동

  2. 검색 플랫폼이 Data Catalog로 설정된 경우 검색 플랫폼 선택 메뉴에서 Knowledge Catalog를 선택합니다.

  3. 프로젝트 전반에서 리소스 찾기 필드에 쿼리를 입력합니다.

  4. 검색을 미세 조정하려면 필터 패널을 사용합니다. 사용할 수 있는 필터는 다음과 같습니다.

    • 시스템은 BigQuery 또는 Cloud SQL과 같은 사용 가능한 시스템 목록을 제공합니다. Knowledge Catalog 시스템에는 커스텀 항목이 포함되어 있습니다.
    • 관점 (태그)을 사용하면 특정 템플릿을 사용하여 태그된 애셋을 쿼리할 수 있습니다. 맞춤설정 메뉴를 사용하여 결과를 미세 조정하고 특정 관점 값별로 필터링할 수 있습니다.
    • 프로젝트에는 검색 범위를 지정할 수 있는 프로젝트가 나열됩니다.
    • 유형 별칭은 항목 유형과 연결된 데이터 유형입니다. 항목 유형의 이름이 projects/test-project/locations/us/entryTypes/my-entry-type일 수 있지만 유형 별칭 TABLE 또는 DATABASE을 사용하여 검색할 수 있습니다. 항목 유형을 만들거나 업데이트할 때 하나 이상의 유형 별칭을 설정할 수 있습니다.
    • 데이터 세트는 BigQuery에서 가져옵니다.

    다음 필터를 수동으로 추가할 수 있습니다.

    • 프로젝트 필터 추가: 프로젝트에서 프로젝트 추가를 클릭합니다. 특정 프로젝트를 검색하여 프로젝트를 선택한 후 열기를 클릭합니다.
    • 관점 유형 필터 추가: 관점에서 관점 유형 추가 메뉴를 클릭합니다. 특정 템플릿을 검색하여 선택한 후 확인을 클릭합니다.
  5. 선택사항: 사용 가능한 애셋 외에도 공개 데이터 세트 포함을 선택하여 Google Cloud 에서 공개적으로 사용할 수 있는 리소스를 검색할 수 있습니다.

    다음 도움말을 사용하여 검색어를 작성하세요.

    • 공백이 포함된 경우 검색 표현식을 따옴표로 묶습니다. 예를 들면 "search terms"입니다.
    • 키워드 앞에 NOT을 추가하여 keyword:term 필터의 논리적 부정과 일치하는 항목을 찾습니다. ANDOR 불리언 연산자를 사용하여 검색 표현식을 조합할 수도 있습니다. AND, OR, NOT 연산자는 대소문자를 구분하지 않습니다.

    예를 들어 NOT column:term는 지정된 용어와 일치하는 열을 제외한 모든 열을 나열합니다.

  6. 검색된 리소스에 대한 자세한 정보를 보려면 검색 결과에서 리소스 이름을 클릭합니다. 그러면 항목 세부정보 페이지가 열립니다.

gcloud

리소스를 검색하려면 gcloud dataplex entries search 명령어를 사용합니다.

C#

C#

이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용C# 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog C# API 참고 문서를 참고하세요.

Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

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 빠른 시작: 클라이언트 라이브러리 사용Go 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog Go API 참고 문서를 참고하세요.

Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.


//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

이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용Java 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog Java API 참고 문서를 참고하세요.

Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

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

이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용Node.js 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog Node.js API 참고 문서를 참고하세요.

Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

/**
 * 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

이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용PHP 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog PHP API 참고 문서를 참고하세요.

Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

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

이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용Python 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog Python API 참고 문서를 참고하세요.

Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

# 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

이 샘플을 사용해 보기 전에 Knowledge Catalog 빠른 시작: 클라이언트 라이브러리 사용Ruby 설정 안내를 따르세요. 자세한 내용은 Knowledge Catalog Ruby API 참고 문서를 참고하세요.

Knowledge Catalog에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

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 메서드를 사용합니다.

키워드 전용 검색 구문

정확한 검색을 위해 한정자, 논리 연산자, 관점 검색을 포함한 특정 문법을 사용하여 쿼리를 구성할 수 있습니다.

한정된 조건자

특정 메타데이터 조각으로 일치를 제한하는 키를 조건자에 프리픽스로 추가하여 조건자를 한정시킬 수 있습니다.

  • 등호(=)는 검색을 일치검색으로 제한합니다.
  • 키 뒤의 콜론 (:)은 조건자를 검색 결과 값의 하위 문자열이나 토큰과 일치시킵니다.

토큰화는 텍스트 스트림을 일련의 토큰으로 나누며 일반적으로 각 토큰은 단어 하나에 해당합니다.

조건자 키 type, system, location, orgid는 하위 문자열 한정자(:)가 아닌 완전 일치(=) 한정자만 지원합니다. 예를 들어 type=foo 또는 orgid=number와 같이 사용됩니다.

Knowledge Catalog 키워드 검색은 다음 한정자를 지원합니다.

한정자 설명
name:x x를 리소스 ID 하위 문자열로 일치시킵니다.
displayname:x x를 리소스 표시 이름의 하위 문자열로 일치시킵니다.
column:x 리소스 스키마에서 열 이름(또는 중첩 열 이름)의 하위 문자열인 x와 일치합니다.
description:x 리소스 설명에서 토큰인 x와 일치합니다.
label:bar 라벨(일부 값 포함)이 있고 라벨 키에 bar가 하위 문자열로 있는 BigQuery 리소스와 일치합니다.
label=bar 라벨(일부 값 포함)이 있고 라벨 키가 문자열인 bar와 같은 BigQuery 리소스와 일치합니다.
label:bar:x BigQuery 리소스에 bar 키가 연결된 라벨의 값에서 하위 문자열인 x와 일치합니다.
label=foo:bar 키가 foo이고 키 값이 bar인 BigQuery 리소스와 일치합니다.
label.foo=bar 키가 foo이고 키 값이 bar인 BigQuery 리소스와 일치합니다.
label.foo 키가 문자열로 foo인 라벨이 있는 BigQuery 리소스와 일치합니다.
type=TYPE 특정 항목 유형 또는 유형 별칭의 리소스와 일치합니다.
projectid:bar ID에 bar를 하위 문자열로 포함하는 Google Cloud 프로젝트 내 리소스와 일치합니다.
parent:x 리소스의 계층 경로의 하위 문자열인 x와 일치합니다. 상위 경로는 상위 리소스의 fully_qualified_name입니다.
orgid=number number의 정확한 ID 값을 가진 Google Cloud 조직 내의 리소스와 일치합니다.
system=SYSTEM 지정된 시스템의 리소스와 일치합니다.
location=LOCATION

지정된 위치의 리소스를 정확한 이름으로 일치시킵니다. 예를 들어 location=us-central1은 Iowa에 호스팅되는 애셋과 일치합니다.

BigQuery Omni 애셋은 BigQuery Omni 위치 이름을 사용하여 이 한정자를 지원합니다. 예를 들어 location=aws-us-east-1은 버지니아 북부의 BigQuery Omni 애셋과 일치합니다.

createtime

지정된 날짜나 시간 내에, 이전 또는 이후에 생성된 리소스를 찾습니다.

예를 들면 다음과 같습니다.

  • createtime:2019-01-01: 2019-01-01에 생성된 리소스와 일치합니다.
  • createtime<2019-02: 2019-02-01T00:00:00 이전에 생성된 리소스와 일치합니다.
  • createtime>2019-02: 2019-02-01T00:00:00 이후에 생성된 리소스와 일치합니다.

타임스탬프 형식: YYYY-MM-DDThh:mm:ss

모든 타임스탬프는 GMT여야 합니다(시간대가 지원되지 않음). 부분 타임스탬프, 하이픈(-) 날짜 구분선, 슬래시(/) 날짜 구분선이 지원됩니다.

예를 들면 다음과 같습니다.

  • 2010-10-22T05:36:24
  • 2010-10-22T05:36
  • 2010-10-22T05
  • 2010-10-22
  • 2010-10
  • 2010
  • 2010/10/22
updatetime

지정된 날짜나 시간 내에, 이전 또는 이후에 업데이트된 리소스를 찾습니다.

예를 들면 다음과 같습니다.

  • updatetime:2019-01-01: 2019-01-01에 업데이트된 리소스와 일치합니다.
  • updatetime<2019-02: 2019-02-01T00:00:00 이전에 업데이트된 리소스와 일치합니다.
  • updatetime>2019-02: 2019-02-01T00:00:00 이후에 업데이트된 리소스와 일치합니다.

타임스탬프 형식: YYYY-MM-DDThh:mm:ss

모든 타임스탬프는 GMT여야 합니다(시간대가 지원되지 않음). 부분 타임스탬프, 하이픈(-) 날짜 구분선, 슬래시(/) 날짜 구분선이 지원됩니다.

예를 들면 다음과 같습니다.

  • 2010-10-22T05:36:24
  • 2010-10-22T05:36
  • 2010-10-22T05
  • 2010-10-22
  • 2010-10
  • 2010
  • 2010/10/22
fully_qualified_name:x xfully_qualified_name의 하위 문자열로 일치시킵니다.
fully_qualified_name=x fully_qualified_name으로 x와 일치합니다.

연결된 관점을 기반으로 항목을 검색하려면 다음 쿼리 문법을 사용합니다.

한정자 설명
aspect:x 항목에 연결된 관점의 관점 유형에 대한 전체 경로의 하위 문자열로서 x와 일치합니다(projectid.location.ASPECT_TYPE_ID 형식).
aspect=x 항목에 연결된 관점의 관점 유형에 대한 전체 경로로서 x와 일치합니다(projectid.location.ASPECT_TYPE_ID 형식).
aspect:xOPERATORvalue

관점 필드 값을 검색합니다. 항목에 연결된 관점의 관점 유형 및 필드 이름에 대한 전체 경로의 하위 문자열로서 x와 일치합니다(projectid.location.ASPECT_TYPE_ID.FIELD_NAME 형식).

지원되는 연산자 목록은 다음과 같이 관점의 필드 유형에 따라 다릅니다.

  • 문자열: =(일치검색) 및 :(하위 문자열)
  • 모든 숫자 유형: =, :, <, >, <=, >=, =>, =<
  • Enum: =
  • 날짜/시간: 숫자와 동일하지만 비교할 값이 숫자가 아닌 날짜/시간으로 처리됩니다.
  • 불리언: =

관점의 최상위 필드만 검색할 수 있습니다.

예를 들어 다음 쿼리는 모두 employee-info 관점의 is-enrolled 필드 값이 true인 항목과 일치합니다. 하위 문자열과 일치하는 다른 항목도 반환됩니다.

  • aspect:example-project.us-central1.employee-info.is-enrolled=true
  • aspect:example-project.us-central1.employee=true
  • aspect:employee=true

논리 연산자

쿼리는 논리 연산자 AND, OR 또는 NOT로 연결된 여러 조건자로 구성될 수 있습니다.

  • 연산자를 지정하지 않으면 논리적 AND가 암시적으로 사용됩니다. 예를 들어 foo bar는 조건자 foobar와 일치하는 리소스를 반환합니다.
  • - (하이픈) 또는 NOT 프리픽스를 사용하여 조건자를 부정합니다. 예를 들어 -name:foo는 이름이 조건자 foo와 일치하지 않는 리소스를 반환합니다.

키워드 전용 검색에서는 논리 연산자가 대소문자를 구분하지 않습니다.

축약된 구문

쿼리에서 축약된 문법을 사용하려면 OR 연산자에 | (세로 막대)를, AND 연산자에 , (쉼표)를 사용하세요. 축약된 구문은 label을 제외한 자격이 있는 서술어에 적용됩니다.

다음 예시에서는 키워드 전용 검색과 함께 축약된 문법을 사용하는 방법을 보여줍니다.

  • OR 연산자를 사용하여 여러 프로젝트 중 하나에서 항목 검색

    projectid:(id1|id2|id3|id4)
    

    축약된 문법을 사용하지 않고 같은 검색을 수행하면 다음과 같이 표시됩니다.

    projectid:id1 OR projectid:id2 OR projectid:id3 OR projectid:id4
    
  • 일치하는 열 이름이 있는 항목을 검색하려면 다음 단계를 따르세요.

    • AND: column:(name1,name2,name3)
    • OR: column:(name1|name2|name3)

다음 단계