---
sourceDocument: オーストラリア ServiceNow AI Platform の機能
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/servicenow-platform

 Release :

    - australia

ft:locale :

    - ja-JP

ft:publication_title :

    - オーストラリア ServiceNow AI Platform の機能

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# KBPortalServiceImpl - グローバル

# KBPortalServiceImpl - グローバル {#ariaid-title1}

* リリースバージョン: Australia
* 
* 更新日 2026年03月12日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：3分

`KBPortalServiceImpl` API は、ナレッジ管理 v3 \[com.snc.knowledge3\] にスクリプトインクルードとして含まれています。カスタム検索とのデータ連携など、ナレッジとともに使用するためのメソッドを提供します。

## KBPortalServiceImpl - KBPortalServiceImpl() {#ariaid-title2}

グローバル アプリケーションで KBPortalServiceImpl オブジェクトをインスタンス化します。
{#kbportalserviceimpl-kbportalserviceimpl__table_m4w_vj1_sdb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 1. パラメーター]

{#kbportalserviceimpl-kbportalserviceimpl__table_m4w_vj1_sdb}

## KBPortalServiceImpl - getResultData(Object request) {#ariaid-title3}

ナレッジ記事およびユーザーに読込可能アクセス権限がある関連ナレッジからのキーワードに基づいて、検索結果を戻します。
ナレッジ ブロック機能を有効にし、アプリケーションに関するナレッジのカスタム検索を使用している場合、キーワードがブロックに含まれていると、関連する記事が戻されないことがあります。記事およびユーザーに読込可能アクセス権限がある関連ブロック コンテンツからのキーワードに基づいて検索結果を戻すためには、`getResultData()` メソッドをカスタム検索内で呼び出す必要があります。
{#kbportalserviceimpl-getresultdata_o__table_zg2_zvj_4db__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| 要求 | オブジェクト | 検索を絞り込む JSON オブジェクト。 |
[表 : 2. パラメーター]

{#kbportalserviceimpl-getresultdata_o__table_zg2_zvj_4db} {#kbportalserviceimpl-getresultdata_o__table_ah2_zvj_4db__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | ナレッジ記事およびユーザーに読込可能アクセス権限がある関連ナレッジ ブロック コンテンツからのキーワードに基づく JSON 形式での検索結果の配列。 |
[表 : 3. 返される内容]

{#kbportalserviceimpl-getresultdata_o__table_ah2_zvj_4db}  

### カスタム検索のナレッジ ブロックへのデータ連携

    function doKeywordSearch(queryText, count, queryLocation) {
      var results = [];
      
      // To set up the request.
      var request = {
        keyword: queryText,
        language: "",

        // To pass data to filter on different metadata.
        variables: {
          kb_knowledge_base: ['Knowledge'],
          kb_category: '',
          author: ['']
        },
     
        // Provide the following.
        context: gs.getProperty('glide.knowman.sp.search_context', 'Knowledge Search'),
        resource: 'Knowledge',
        order: "relevancy,true",

        // Provide the pagination variables.
        start: queryLocation,
        end: queryLocation+count,

        attachment: false,

        // Provide any additional metadata you want to include in your results.
        knowledge_fields: [
          "number",
          "sys_id",
          "published"
        ]
      };

      // To execute the search.
      var response = new KBPortalServiceImpl();
      response.getResultData(request);

      // To send the search results back to the UI or to store results in your object.
      for (var i = 0; i < response.results.length; i++) {
        result = response.results[i];
        var article = {};
        article.sys_id = result.meta.sys_id.display_value;
        article.number = result.meta.number.display_value;
        article.short_description = article.short_description;
        article.title = result.title;
        article.published = result.meta.published.display_value;
        article.publishedUTC = result.meta.published.display_value;
        article.text = article.text;
        article.score = result.meta.score;
        article.label = article.short_description;
        article.shortDescription = article.short_description;
        results.push(article);
      }

      return results;
    }


