Menggunakan penelusuran khusus kata kunci di Knowledge Catalog

Gunakan penelusuran khusus kata kunci di Knowledge Catalog untuk menemukan resource menggunakan kata kunci, filter, dan sintaksis tertentu. Penelusuran khusus kata kunci memberikan kontrol yang presisi atas kueri penelusuran dan memungkinkan Anda mempersempit hasil berdasarkan kolom metadata.

Sebelum memulai

Sebelum melakukan penelusuran, pastikan Anda diberi peran yang diperlukan dan telah mengaktifkan API yang diperlukan.

Peran yang diperlukan

Untuk mendapatkan izin yang Anda perlukan untuk menelusuri entri dan mengakses hasil penelusuran di Knowledge Catalog, minta administrator untuk memberi Anda peran IAM berikut:

Untuk mengetahui informasi selengkapnya tentang pemberian peran, lihat Mengelola akses ke project, folder, dan organisasi.

Anda mungkin juga bisa mendapatkan izin yang diperlukan melalui peran khusus atau peran bawaan lainnya.

Menggunakan penelusuran khusus kata kunci

Konsol

Untuk menelusuri resource menggunakan penelusuran kata kunci, ikuti langkah-langkah berikut:

  1. Di konsol Google Cloud , buka halaman Penelusuran Knowledge Catalog.

    Buka Penelusuran

  2. Jika platform penelusuran Anda disetel ke Data Catalog, di menu Choose search platform, pilih Knowledge Catalog.

  3. Di kolom Find resources across projects, masukkan kueri Anda.

  4. Untuk menyaring penelusuran, gunakan panel Filter. Filter berikut tersedia:

    • Sistem menyediakan daftar sistem yang tersedia, seperti BigQuery atau Cloud SQL. Sistem Knowledge Catalog berisi entri kustom.
    • Aspek (tag) memungkinkan Anda membuat kueri untuk aset yang diberi tag menggunakan template tertentu. Anda dapat menggunakan menu Sesuaikan untuk lebih menyaring hasil dan memfilter menurut nilai aspek tertentu.
    • Project mencantumkan project yang dapat Anda cakupkan penelusurannya.
    • Alias jenis adalah jenis data yang terkait dengan jenis entri. Jenis entri mungkin memiliki nama projects/test-project/locations/us/entryTypes/my-entry-type, tetapi Anda dapat menelusurinya menggunakan alias jenis TABLE atau DATABASE. Anda dapat menetapkan satu atau beberapa alias jenis saat membuat atau memperbarui jenis entri.
    • Set data berasal dari BigQuery.

    Anda dapat menambahkan filter berikut secara manual:

    • Tambahkan filter project: di Project, klik Tambahkan project. Telusuri project tertentu, pilih project, lalu klik Buka.
    • Menambahkan filter jenis aspek: di Aspek, klik menu Tambahkan jenis aspek lainnya. Telusuri template tertentu, pilih template tersebut, lalu klik Oke.
  5. Opsional: Selain aset yang tersedia untuk Anda, Anda dapat menelusuri resource yang tersedia untuk publik di Google Cloud dengan memilih Sertakan set data publik.

    Gunakan tips berikut untuk membuat kueri penelusuran:

    • Sertakan ekspresi penelusuran Anda dalam tanda kutip jika berisi spasi. Misalnya, "search terms".
    • Awali kata kunci dengan NOT untuk mencocokkan negasi logis filter keyword:term. Anda juga dapat menggunakan operator Boolean AND dan OR untuk menggabungkan ekspresi penelusuran. Operator AND, OR, dan NOT tidak peka huruf besar/kecil.

    Misalnya, NOT column:term mencantumkan semua kolom kecuali yang cocok dengan istilah yang ditentukan.

  6. Untuk melihat informasi selengkapnya tentang resource yang dicari, di hasil penelusuran, klik nama resource. Tindakan ini akan membuka halaman detail entri.

gcloud

Untuk menelusuri resource, gunakan perintah gcloud dataplex entries search.

C#

C#

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Knowledge Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Knowledge Catalog C# API.

Untuk melakukan autentikasi ke Knowledge Catalog, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Go di Panduan memulai Knowledge Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Knowledge Catalog Go API.

Untuk melakukan autentikasi ke Knowledge Catalog, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.


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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Knowledge Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Knowledge Catalog Java API.

Untuk melakukan autentikasi ke Knowledge Catalog, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Node.js di Panduan memulai Knowledge Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Knowledge Catalog Node.js API.

Untuk melakukan autentikasi ke Knowledge Catalog, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan PHP di Panduan memulai Knowledge Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Knowledge Catalog PHP API.

Untuk melakukan autentikasi ke Knowledge Catalog, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Python di Panduan memulai Knowledge Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Knowledge Catalog Python API.

Untuk melakukan autentikasi ke Knowledge Catalog, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

# 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

Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Ruby di Panduan memulai Knowledge Catalog menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat dokumentasi referensi Knowledge Catalog Ruby API.

Untuk melakukan autentikasi ke Knowledge Catalog, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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

Untuk menelusuri resource, gunakan metode searchEntries.

Sintaksis penelusuran khusus kata kunci

Untuk penelusuran yang akurat, Anda dapat membuat kueri menggunakan sintaksis tertentu, termasuk penentu, operator logika, dan penelusuran aspek.

Predikat yang memenuhi syarat

Anda dapat memenuhi syarat predikat dengan menambahkan awalan kunci yang membatasi pencocokan ke bagian metadata tertentu:

  • Tanda sama dengan (=) membatasi penelusuran ke pencocokan persis.
  • Titik dua (:) setelah kunci mencocokkan predikat dengan sub-string atau token dalam nilai di hasil penelusuran.

Tokenisasi membagi aliran teks menjadi serangkaian token, dengan setiap token biasanya sesuai dengan satu kata.

Kunci predikat type, system, location, dan orgid hanya mendukung pencocokan persis (=), bukan pencocokan substring (:). Misalnya, type=foo atau orgid=number.

Penelusuran kata kunci Knowledge Catalog mendukung penentu berikut:

Penentu Deskripsi
name:x Mencocokkan x sebagai substring ID resource.
displayname:x Mencocokkan x sebagai substring dari nama tampilan resource.
column:x Mencocokkan x sebagai substring nama kolom (atau nama kolom bertingkat) dalam skema resource.
description:x Cocok dengan x sebagai token dalam deskripsi resource.
label:bar Mencocokkan resource BigQuery yang memiliki label (dengan beberapa nilai) dan kunci label memiliki bar sebagai substring.
label=bar Mencocokkan resource BigQuery yang memiliki label (dengan beberapa nilai) dan kunci label sama dengan bar sebagai string.
label:bar:x Mencocokkan x sebagai substring dalam nilai label dengan kunci bar yang dilampirkan ke resource BigQuery.
label=foo:bar Mencocokkan resource BigQuery dengan kunci yang sama dengan foo dan nilai kunci yang sama dengan bar.
label.foo=bar Mencocokkan resource BigQuery dengan kunci yang sama dengan foo dan nilai kunci yang sama dengan bar.
label.foo Mencocokkan resource BigQuery yang memiliki label dengan kunci yang sama dengan foo sebagai string.
type=TYPE Mencocokkan resource dari jenis entri tertentu atau alias jenisnya.
projectid:bar Mencocokkan resource dalam project Google Cloud yang cocok dengan bar sebagai substring dalam ID.
parent:x Mencocokkan x sebagai substring jalur hierarkis resource. Jalur induk adalah fully_qualified_name dari resource induk.
orgid=number Mencocokkan resource dalam organisasi Google Cloud dengan nilai ID persis number.
system=SYSTEM Mencocokkan resource dari sistem yang ditentukan.
location=LOCATION

Mencocokkan resource di lokasi tertentu dengan nama yang sama persis. Misalnya, location=us-central1 cocok dengan aset yang dihosting di Iowa.

Aset BigQuery Omni mendukung penentu ini dengan menggunakan nama lokasi BigQuery Omni. Misalnya, location=aws-us-east-1 cocok dengan aset BigQuery Omni di Virginia Utara.

createtime

Menemukan resource yang dibuat dalam, sebelum, atau setelah tanggal atau waktu tertentu.

Contoh:

  • createtime:2019-01-01 cocok dengan resource yang dibuat pada 2019-01-01.
  • createtime<2019-02 cocok dengan resource yang dibuat sebelum 2019-02-01T00.00.00.
  • createtime>2019-02 cocok dengan resource yang dibuat setelah 2019-02-01T00:00:00.

Format stempel waktu: YYYY-MM-DDThh:mm:ss

Semua stempel waktu harus dalam GMT; zona waktu tidak didukung. Stempel waktu parsial, pemisah tanggal tanda hubung (-), dan pemisah tanggal garis miring (/) didukung.

Contoh:

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

Menemukan resource yang diperbarui dalam, sebelum, atau setelah tanggal atau waktu tertentu.

Contoh:

  • updatetime:2019-01-01 cocok dengan resource yang diperbarui pada 1 Januari 2019.
  • updatetime<2019-02 cocok dengan resource yang diperbarui sebelum 2019-02-01T00.00.00.
  • updatetime>2019-02 cocok dengan resource yang diperbarui setelah 2019-02-01T00:00:00.

Format stempel waktu: YYYY-MM-DDThh:mm:ss

Semua stempel waktu harus dalam GMT; zona waktu tidak didukung. Stempel waktu parsial, pemisah tanggal tanda hubung (-), dan pemisah tanggal garis miring (/) didukung.

Contoh:

  • 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 Mencocokkan x sebagai substring dari fully_qualified_name.
fully_qualified_name=x Mencocokkan x sebagai fully_qualified_name.

Untuk menelusuri entri berdasarkan aspek yang dilampirkan, gunakan sintaksis kueri berikut.

Penentu Deskripsi
aspect:x Mencocokkan x sebagai substring dari jalur lengkap ke jenis aspek dari aspek yang dilampirkan ke entri, dalam format projectid.location.ASPECT_TYPE_ID
aspect=x Mencocokkan x sebagai jalur lengkap ke jenis aspek dari aspek yang dilampirkan ke entri, dalam format projectid.location.ASPECT_TYPE_ID
aspect:xOPERATORvalue

Menelusuri nilai kolom aspek. Mencocokkan x sebagai substring dari jalur lengkap ke jenis aspek dan nama kolom aspek yang dilampirkan ke entri, dalam format projectid.location.ASPECT_TYPE_ID.FIELD_NAME

Daftar operator yang didukung bergantung pada jenis kolom dalam aspek, sebagai berikut:

  • String: = (pencocokan persis) dan : (substring)
  • Semua jenis angka: =, :, <, >, <=, >=, =>, =<
  • Enum: =
  • Datetime: sama seperti untuk angka, tetapi nilai yang akan dibandingkan diperlakukan sebagai tanggal dan waktu, bukan angka
  • Boolean: =

Hanya kolom tingkat teratas aspek yang dapat ditelusuri.

Misalnya, semua kueri berikut cocok dengan entri yang nilai kolom is-enrolled dalam aspek employee-info adalah true. Entri lain yang cocok dengan substring juga ditampilkan.

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

Operator logika

Kueri dapat terdiri dari beberapa predikat yang ditautkan dengan operator logis AND, OR, atau NOT.

  • Jika Anda tidak menentukan operator, AND logika akan tersirat. Misalnya, foo bar menampilkan resource yang cocok dengan predikat foo dan predikat bar.
  • Menegasikan predikat dengan awalan - (tanda hubung) atau NOT. Misalnya, -name:foo menampilkan resource dengan nama yang tidak cocok dengan predikat foo.

Dalam penelusuran khusus kata kunci, operator logika tidak peka huruf besar/kecil.

Sintaksis singkat

Untuk menggunakan sintaksis singkat dalam kueri, gunakan | (batang vertikal) untuk operator OR dan , (koma) untuk operator AND. Sintaksis singkat berfungsi untuk predikat yang memenuhi syarat, kecuali label.

Contoh berikut menunjukkan cara menggunakan sintaksis singkat dengan penelusuran khusus kata kunci.

  • Menelusuri entri di dalam salah satu dari banyak project menggunakan operator OR

    projectid:(id1|id2|id3|id4)
    

    Penelusuran yang sama tanpa menggunakan sintaks singkat akan terlihat seperti berikut:

    projectid:id1 OR projectid:id2 OR projectid:id3 OR projectid:id4
    
  • Menelusuri entri dengan nama kolom yang cocok:

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

Langkah berikutnya