---
title: "カスタムの製品リポジトリ名または場所を使います"
slug: "use-a-custom-product-repository-name-or-location"
abstract: "標準の名前と場所を使わない場合のカスタム製品リポジトリの使い方の概要。"
---
# カスタムの製品リポジトリ名または場所を使います

製品同期を利用する外部コマースシステムと統合するためにSitecoreを設定する際には、[製品リポジトリ](https://doc.sitecore.com/xp/ja/developers/101/sitecore-experience-commerce/understanding-the-product-repository.html "Understanding the product repository")を作成しなければなりません。製品リポジトリのデフォルト名と場所は /sitecore/content/Product Repositoryです。カスタム製品リポジトリ名や場所を使用したい場合は、設定を調整しなければなりません。

> !注製品リポジトリは通常*/sitecore/Content/*に保存されているウェブサイトと混同を避けるために、*/sitecore/content*の下に独立したフォルダに保存するのがベストプラクティスです。

カスタム製品リポジトリ名または場所を使用するには:

1.  /App\_Config/Include/Sitecore.Commerce.Products.configファイルで以下の属性を編集してください:
    
    <paths productRepository="/sitecore/content/Product Repository">
    
2.  Solrインデックスエンジンの2つのインデックスファイルの構成を変更するには、以下のサンプルの行を更新してください:
    
    -   Sitecore.Commerce.Products.Solr.Index.Master.configファイルで、ProductItemCrawlerのルートを更新します:
        
        <locations hint="list:AddCrawler">
         <crawler type="Sitecore.Commerce.Search.ProductItemCrawler,Sitecore.Commerce.Connect.Core">
           <Database>master</Database>
            <Root>/sitecore/content/Product Repository</Root>
         </crawler>
        </locations>
        
    -   Sitecore.Commerce.Products.Solr.Index.Web.configファイルで、ProductItemCrawlerのルートを更新します:
        
        <locations hint="list:AddCrawler">
         <crawler type="Sitecore.Commerce.Search.ProductItemCrawler,Sitecore.Commerce.Connect.Core">
           <Database>web</Database>
            <Root>/sitecore/content/Product Repository</Root>
         </crawler>
        </locations>
        
3.  マスターデータベースのインデックスのインデックスIDをデフォルトのcommerce\_products\_master\_indexから変更した場合、Sitecore.Commerce.Products.ConfigファイルのProductSynchronization.ProductIndexes設定のIDも置き換える必要があります。
    
    この設定には、製品同期中に一時停止、再開、再構築されるインデックスIDのリストが含まれています。
    
    <!-- PRODUCT INDEXES.
     The indexes 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" />