---
schema_version: "1"
id: e53aca51949b78f82592de75feda6d61135dfc890812951402b6513664d1307f
title: ストア操作の設定
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mulesoft-vectors-connector/1.0/configuring-store-operations.md
canonical_url: https://docs.mulesoft.com/jp/mulesoft-vectors-connector/1.0/configuring-store-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ff3ac7b3c343167839779d78638565b619f928d69981fa6e2bea3fd643bec1aa
description: MuleSoft Documentation Site
release: "1.0"
latest: true
---
# ストア操作の設定

**\[Store\] Add**​、​**\[Store\] Query**​、​**\[Store\] Query All**​、​**\[Store\] Remove**​ 操作を設定します。

## [](#store-add-操作の設定)Store Add 操作の設定

**\[Store\] Add**​ 操作では、ドキュメントまたはテキストをエンベディングストアに追加します。

**\[Store\] Add**​ 操作の前は、テキストをベクトルストアに取り込む ​**\[Embedding\] Generate from text**​ 操作である必要があります。

**\[Store\] Add**​ 操作を設定する手順は、次のとおりです。

Unresolved include directive in modules/ROOT/pages/configuring-store-operations.adoc - include::connectors::partial$t-configure-operations.adoc\[\] \* **Store Name (ストア名)**

\+ 外部ベクトルデータベース内のコレクションの名前を入力します。 \* **Text Segments and Embeddings (テキストセグメントおよびエンベディング)**

\+ ベクトルデータベースに取り込むテキストセグメントとエンベディングを入力します。通常、これは ​**\[Embedding\] Generate from text**​ 操作の出力です。 \* **Metadata entries (メタデータエントリ)**

\+ キー (カスタムメタデータキー) と値 (カスタムメタデータ値) などのリスト項目 (メタデータエントリ) を入力します。

この操作の XML を次に示します。

```xml
<ms-vectors:store-add
  doc:name="[Store] Add"
  doc:id="7ca3df80-8cac-44dc-ad49-860a6f682d04"
  config-ref="MuleSoft_Vectors_Connector_Store_config"
  storeName="gettingstarted" />
```

### [](#出力設定)出力設定

この操作の応答には JSON ペイロードが含まれます。応答の例を次に示します。

```json
{
  "sourceId": "af44c7ef-4562-4712-af09-4498fc7f29a2",
  "embeddingIds": [
    "81f257c6-6406-4936-8c22-0ae523cce5fd",
    "2127ef9b-08f4-4bfc-b769-1f488cdbf835",
    "639e9994-f406-4481-a08a-0058ed3d781e"
  ],
  "status": "updated"
}
```

- `sourceId`​: ソースドキュメントの一意の識別子。
- `embeddingIds`​: ストアに追加されたエンベディングの一意の識別子のリスト。
- `status`​: 操作の状況。

この操作ではその他の属性も返されます。

- `storeName`​: ベクトルストアコレクションの名前。

## [](#store-query-操作の設定)Store Query 操作の設定

**\[Store\] Query**​ 操作では、エンベディング (テキストプロンプトからすでに生成済み) とメタデータに対する検索条件 (省略可能) に基づいてエンベディングストアから情報を取得します。これは次の目的で使用できます。

- **ナレッジ管理システム**
    
    組織のナレッジベースからドキュメントを取得します。
- **カスタマーサポート**
    
    顧客とのやり取りに関するドキュメントを保存して、すばやく取得および分析できるようにします。
- **コンテンツ管理**
    
    さまざまな種別のドキュメント (テキスト、PDF、URL) を中央リポジトリに取り込んで、容易にアクセスおよび検索できるようにします。

**\[Store\] Query**​ 操作の前は、​**\[Embedding\] Generate from text**​ 操作にすることができます。まず、ストアを照会するときに使用するプレーンテキストが ​**\[Embedding\] Generate from text**​ 操作で処理され、エンベディングが生成されます。このエンベディングは、実際のクエリの実行に使用でき、​**\[Store\] Query**​ 操作の入力を表します。

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">クエリ目的でテキストからエンベディングを生成する場合、セグメンテーション項目を指定しないでください。​<strong>[Max Segment Size (Characters) (最大セグメントサイズ (文字数))]</strong>​ 項目と ​<strong>[Max Overlap Size (Characters) (最大重複サイズ (文字数))]</strong>​ 項目は空白のままにしてください。</td></tr></tbody></table>

**\[Store\] Query**​ 操作を設定する手順は、次のとおりです。

Unresolved include directive in modules/ROOT/pages/configuring-store-operations.adoc - include::connectors::partial$t-configure-operations.adoc\[\] \* **Store Name (ストア名)**

\+ 外部ベクトルデータベース内のコレクションの名前を入力します。 \* **Text Segments and Embeddings (テキストセグメントおよびエンベディング)**

\+ ベクトルデータベースに照会するテキストセグメントとエンベディングを入力します。通常、これは ​**\[Embedding\] Generate from text**​ 操作の出力です。テキストセグメントとエンベディングに含まれている要素は 1 つのみである必要があります。 \* **Max Results (最大結果数)**

\+ クエリで戻す結果の最大数を入力します。 \* **Min Score (最少スコア)**

\+ 類似検索の最少スコア (0 ～ 1) を入力します。 \* **Metadata Condition (メタデータ条件)**

\+ メタデータに基づいて結果を絞り込むために使用する条件を入力します。

\+ SQL のような構文がサポートされます。

\+ **比較演算子は ​`=`​、​`!=`​、​`<`​、​`⇐`​、​`>`​、​`>=`​ です。** 特殊演算子: **\* `CONTAINS(field_name, 'value')`​ - 項目に値が含まれているかどうかを確認します。** 論理演算子は ​`AND`​ と ​`OR`​ です。

\+ 例: `index=1 AND (CONTAINS(file_name,'example.pdf') OR file_type='any')`

\+ NOTE: `CONTAINS(field_name, 'value')`​ と ​`field_name LIKE '%value%'`​ は共にほとんどの場合で機能しますが、動作は各ストアプロバイダーで異なることがあります。たとえば、Azure AI Search の場合、これは ​`search.ismatch('value', field_name)`​ にマップされます。

この操作の XML を次に示します。

```xml
<ms-vectors:query
  doc:name="[Store] Query"
  doc:id="b74a5c37-6ea9-42bf-907f-c27183007ec7"
  config-ref="MuleSoft_Vectors_Connector_Store_config"
  storeName="web_pages"
  maxResults="5"
  minScore="0.85"
  metadataKey="url"
  filterMethod="isEqualTo"
  metadataValue="www.salesforce.com"/>
```

### [](#出力設定-2)出力設定

この操作の応答には JSON ペイロードが含まれます。応答の例を次に示します。

```json
{
    "question": "Tell me more about Cloudhub High Availability Feature",
    "sources": [
        {
            "embeddingId": "",
            "text": "= CloudHub High Availability Features\nifndef::env-site,env-github[]\ninclude::_attributes.adoc[]\nendif::[]\n:page-aliases: runtime-manager::cloudhub-fabric.adoc,\....\n\n== Worker Scale-out",
            "score": 0.9282029356714594,
            "metadata": {
                "source_Id": "c426a871-1a6e-4a47-a8ab-027eec9303e1",
                "index": "0"
                "absolute_directory_path": "/Users/<user>/Documents/Downloads/patch 8",
                "file_name": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc",
                "full_path": "/Users/<user>/Documents/Downloads/patch 8docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc",
                "file_type": "any",
                "ingestion_datetime": "2024-11-20T20:34:41.691Z",
                "ingestion_timestamp": "1732134881691"
            }
        },
        {
          ...
        },
        {
          ...
        }
    ]
    "response": "= CloudHub High Availability Features\.. (...) \..distributes HTTP requests among your assigned workers.\n. Persistent message queues (see below)",
    "maxResults": 3,
    "storeName": "gettingstarted",
    "minimumScore": 0.7
}
```

- `question`​: 要求の質問。
- `sources`​: 類似検索によって識別されるソース。
    
    - `embeddingId`​: エンベディング UUID。
    - `text`​: 関連テキストセグメント。
    - `score`​: 質問に基づく類似検索のスコア。
    - `metadata`​: メタデータのキー-値ペア。
    - `source_id`​: アップロードされたデータソースの UUID。
    - `index`​: アップロードされたデータソースのセグメントまたはチャンク番号。
    - `absolute_directory_path`​: 関連テキストセグメントが含まれるファイルへのフルパス。
    - `file_name`​: テキストセグメントが含まれているファイルの名前。
    - `full_path`​: ファイルへのフルパス。
    - `file_Type`​: ファイル種別。
    - `ingestion_datetime`​: ISO 8601 形式の取り込み日時 (UTC)。
    - `ingestion_timestamp`​: 取り込み時刻 (ミリ秒)。
- `response`​: すべての関連テキストセグメントの収集済み応答。この応答は LLM に送信されます。
- `maxResults`​: 考慮するテキストセグメントの最大数。
- `storeName`​: ベクトルストアの名前。
- `minimumScore`​: 結果の最少スコア。

この操作ではその他の属性も返されます。

- `storeName`​: ベクトルストアコレクションの名前。
- `metadataCondition`​ (省略可能): エンベディングの照会に使用する検索条件。

## [](#store-query-all-操作の設定)Store Query All 操作の設定

**\[Store\] Query All**​ 操作では、エンベディングストアへのすべてのソースをリストします。

**\[Store\] Query All**​ 操作を設定する手順は、次のとおりです。

Unresolved include directive in modules/ROOT/pages/configuring-store-operations.adoc - include::connectors::partial$t-configure-operations.adoc\[\] \* **Store Name (ストア名)**

\+ 外部ベクトルデータベース内のコレクションの名前を入力します。 \* **Retrieve Embeddings (エンベディングを取得)**

\+ true の場合、エンベディングをストアから取得します。

\+ NOTE: Azure AI Search を使用してストアをエンベディングと共に照会する場合、コネクタで「​`「Invalid expression: 'content_vector' is not a retrievable field. Only fields marked as retrievable in the index can be used in $select.\r\nParameter name: $select (無効な式:'content_vector' は取得可能な項目ではありません。インデックスで取得可能としてマークされた項目のみを $select で使用できます。\r\nパラメーター名: $select)」`​」というエラーが返されることがあります。問題を解決するには、'content\_vector' を取得可能な項目として設定します。 \* **Page Size (ページサイズ)**

\+ ストアを照会するときに使用するページサイズを入力します。

この操作の XML を次に示します。

```xml
<ms-vectors:query-all
  doc:name="[Store] Query All"
  doc:id="4ba6854a-0580-46de-9c36-a4843abf6fb7"
  config-ref="MuleSoft_Vectors_Connector_Store_config"
  storeName="gettingStarted"
  pageSize="5000"
  retrieveEmbeddings="false"/>
```

### [](#出力設定-3)出力設定

この操作の応答には JSON ペイロードが含まれます。応答の例を次に示します。

```json
[
  {
    "embeddingId": "81f257c6-6406-4936-8c22-0ae523cce5fd",
    "text": "E-commerce giants like Amazon and Alibaba have redefined ..",
    "metadata": {
        "index": "0",
        "source": "s3://ms-vectors/invoicesample.pdf",
        "file_type": "any",
        "file_name": "invoicesample.pdf"
        ...
    },
    "embeddings": [-0.00683132, -0.0033572172, 0.02698761, -0.01291587, ...]
  }
]
```

- `embeddingId`​: エンベディング UUID。
- `text`​: 関連テキストセグメント。
- `metadata`​: メタデータのキー-値ペア。
    
    - `index`​: アップロードされたデータソースのセグメントまたはチャンク番号。
    - `source`​: テキストセグメントのソース。
    - `file_type`​: ファイル種別。
    - `file_name`​: テキストセグメントが含まれているファイルの名前。
- `embeddings`​: テキストセグメントのエンベディング。

この操作ではその他の属性も返されます。

- `storeName`​: ベクトルストアコレクションの名前。

## [](#store-remove-操作の設定)Store Remove 操作の設定

**\[Store\] Remove**​ 操作では、メタデータ検索条件に基づいてストアからすべてのエンベディングを削除します。

**\[Store\] Remove**​ 操作を設定する手順は、次のとおりです。

Unresolved include directive in modules/ROOT/pages/configuring-store-operations.adoc - include::connectors::partial$t-configure-operations.adoc\[\] \* **Store Name (ストア名)**

\+ 外部ベクトルデータベース内のコレクションの名前を入力します。 \* **Ids (ID)**

\+ 削除する ID のリストを入力します。 \* **Metadata Condition (メタデータ条件)**

\+ メタデータに基づいて結果を絞り込むために使用する条件を入力します。

\+ SQL のような構文がサポートされます。

\+ **比較演算子は ​`=`​、​`!=`​、​`<`​、​`⇐`​、​`>`​、​`>=`​ です。** 特殊演算子: **\* `CONTAINS(field_name, 'value')`​ - 項目に値が含まれているかどうかを確認します。** 論理演算子は ​`AND`​ と ​`OR`​ です。

\+ 例: `index=1 AND (CONTAINS(file_name,'example.pdf') OR file_type='any')`

\+ NOTE: `CONTAINS(field_name, 'value')`​ と ​`field_name LIKE '%value%'`​ は共にほとんどの場合で機能しますが、動作は各ストアプロバイダーで異なることがあります。たとえば、Azure AI Search の場合、これは ​`search.ismatch('value', field_name)`​ にマップされます。

この操作の XML を次に示します。

```xml
<ms-vectors:store-remove
  doc:name="Embedding remove documents by filter"
  doc:id="c6b9ec97-1224-445e-ab02-f598d6fff7d7"
  config-ref="MAC_Vectors_Config"
  storeName="mulechaindemo"
  metadataKey="file_name"
  filterMethod="isEqualTo"
  metadataValue="docs-accelerators__accelerators-cim_1.3_modules_ROOT_pages_cim-setup.adoc"
  embeddingModelName="text-embedding-3-small"/>
```

### [](#出力設定-4)出力設定

この操作の応答には JSON ペイロードが含まれます。応答の例を次に示します。

```json
{
    "status": "deleted"
}
```

- `status`​: 操作の状況。

この操作ではその他の属性も返されます。

- `storeName`​: ベクトルストアコレクションの名前。
- `ids`​ (省略可能): 削除するエンベディングの ID。
- `metadataCondition`​ (省略可能): エンベディングの削除に使用する検索条件。

## [](#関連情報)関連情報

- [MuleSoft Vectors Connector の概要](https://docs.mulesoft.com/jp/mulesoft-vectors-connector/1.0/)
- [MuleSoft Vectors Connector リファレンス](https://docs.mulesoft.com/jp/mulesoft-vectors-connector/1.0/mulesoft-vectors-connector-reference)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)