インデキシング

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

Connectをインストールすると、デフォルトのインデックスにパッチが適用され、すべての商品データが除外され、拡張商品データを含む別の商品インデックスが作成されます。

すべての製品または製品のリストを同期している間、インデックス作成は停止します。同期が完了すると、インデックスが再構築されます。これは、パフォーマンス上の理由から行われます。次の構成スニペットは、インデックス作成に関連するプロセッサを含むSynchronizeProductListパイプラインの既定の構成を示しています。

<commerce.synchronizeProducts.synchronizeProductList>
<processor type="Sitecore.Commerce.Pipelines.Products.SynchronizeProductList.PauseSearchIndexing, Sitecore.Commerce" />
<processor type="Sitecore.Commerce.Pipelines.Products.SynchronizeProductList.SynchronizeProductList, Sitecore.Commerce" />
<processor type="Sitecore.Commerce.Pipelines.Products.SynchronizeProductList.ResumeSearchIndexing, Sitecore.Commerce" />
<processor type="Sitecore.Commerce.Pipelines.Products.SynchronizeProductList.RebuildSearchIndexes, Sitecore.Commerce" />
</commerce.synchronizeProducts.synchronizeProductList>

Sitecore.Commerce.Products.Configファイルでは、設定ProductSynchronization.ProductIndexesに、製品の同期中に停止および再開始されるインデックス名のコンマ区切りリストが含まれています。

<!-- PRODUCT INDEXES.
The indexes are used to store synchronized products.
Can be stopped, resumed and rebuilt automatically during product synchronization.
-->
<setting name="ProductSynchronization.ProductIndexes" value="sitecore_master_index, commerce_products_master_index" />
メモ

新しい製品テンプレートまたはカスタム製品テンプレートが導入された場合は、DefaultIndexConfigurationとProductインデックス構成の両方を更新する必要があります。

警告

追加のインデックスを作成する場合は、インデックスの名前を含めるように設定を更新する必要があります。そうでない場合、同期中もインデックス作成が続行され、パフォーマンスが低下します。

デフォルトのインデックス

設計上、デフォルトのマスター索引とWeb索引は、製品リポジトリに保管されている項目を含めないように構成されています。デフォルトのインデックス設定には、各製品テンプレートのエントリを含むExcludeセクションでパッチが適用されます。

<exclude hint="list:ExcludeTemplate">
<ProductRepositoryTemplateId>{F599BF48-D6FE-40DC-9F78-CF2D56BFB657}</ProductRepositoryTemplateId>
            <ProductTemplateId>{47D1A39E-3B4B-4428-A9F8-B446256C9581}</ProductTemplateId>

</exclude>

製品インデックス

Connectには、マスターデータベースとWebデータベースの両方に対応する独自の製品インデックスが付属しています。インデックスには、いくつかの目的があります。

  • 2つの別々のインデックスでデータからコンテンツを分離します。

    製品インデックスは、コンテンツ エディター内から製品リポジトリ バケットを検索するときに使用されます。これは、getContextIndexパイプラインにパッチを適用することで実現されます。

    <contentSearch.getContextIndex>
    <processor type="Sitecore.Commerce.Pipelines.ContentIndex.CustomIndex.FetchCustomIndex,
    Sitecore.Commerce"                patch:before="processor[@type='Sitecore.ContentSearch.Pipelines.GetContextIndex.FetchIndex,
    Sitecore.ContentSearch']"/>
    </contentSearch.getContextIndex>
  • 拡張商品データを含めるため。

    commerce.inventory.stockStatusForIndexingパイプラインは、外部のコマースシステムから製品ごとの在庫データを読み取り、インデックスに入力します。計算フィールドは、インベントリ データを含めるために使用されます。設定はSitecore.Commerce.Products.Lucene.Index.Common.configファイルにあります。次の表に、4つのフィールドで拡張された製品インデックスの例を示します。

    • 在庫あり—商品の在庫がある場所のリストが含まれています。

    • 在庫切れ - 商品が在庫切れのロケーションのリストが含まれています。

    • ロケーション - 商品の注文可能なロケーションのリストが含まれます。

    • Pre-Orderable — 商品が予約注文可能かどうかを示すブール値が含まれます。

製品ID(バリアントではない)

大きさ

在庫あり

在庫切れ

場所

予約可能

AW123-04

S、M、L、XL

R、B、G、O

セントラルストア、ストア1、ストア2

ストア3

セントラルストア1、ストア2、ストア3

製品インデックスは、Sitecore.Commerce.Products.Lucene.Index.Master.configファイルで定義されます。Webインデックスについても、同様の構成ファイルが定義されています。

<configuration
xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration,
Sitecore.ContentSearch">
   
<indexes hint="list:AddIndex">
        
<index id="commerce_products_master_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex,
Sitecore.ContentSearch.LuceneProvider">
<param
desc="name">$(id)</param>
            <param desc="folder">$(id)</param>
            <!-- This initializes the index property store. Id has to be set to
the index id -->
            <param
desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)"
/>
            <configuration
ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration"/>
            <strategies
hint="list:AddStrategy">
              <!--
NOTE: Order controls the execution order -->
              <strategy
ref="contentSearch/indexUpdateStrategies/syncMaster" />
            </strategies>
            <commitPolicyExecutor
type="Sitecore.ContentSearch.CommitPolicyExecutor,
Sitecore.ContentSearch">
              <policies
hint="list:AddCommitPolicy">
                <policy
type="Sitecore.ContentSearch.TimeIntervalCommitPolicy,
Sitecore.ContentSearch" />
              </policies>
            </commitPolicyExecutor>
            <locations
hint="list:AddCrawler">
              <crawler
type="Sitecore.Commerce.Search.ProductItemCrawler,
Sitecore.Commerce">
                <Database>master</Database>
                <Root>/sitecore/content/Product Repository</Root>
              </crawler>
            </locations>  
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
手記

製品リポジトリは、/sitecore/content/Product Repositoryのパスの下にあることを前提としています。そうでない場合は、クローラの <Root> エレメントを更新して、実際の位置を反映する必要があります。

カスタムクローラは、Sitecore.Commerce.Products.config設定ファイルの <includeTemplates> セクションで定義された商品テンプレートに基づくアイテムを商品インデックスに含めるために使用されます。このセクションで定義されている製品テンプレートのリストは、DefaultIndexConfigurationの除外テンプレートセクションと完全に一致しています。カスタム製品テンプレートが導入された場合は、インデックス設定を更新する必要があります。

<includeTemplates>
      <ProductRepositoryTemplateId>{F599BF48-D6FE-40DC-9F78-CF2D56BFB657}</ProductRepositoryTemplateId>
      <ProductTemplateId>{47D1A39E-3B4B-4428-A9F8-B446256C9581}</ProductTemplateId>

</includeTemplates>
この記事を改善するための提案がある場合は、 お知らせください!