---
title: "Solr検索プロバイダーの設定"
slug: "configure-the-solr-search-provider"
abstract: "このトピックでは、xConnectでSolr検索プロバイダーを手動で設定する方法について説明します。"
---
# Solr検索プロバイダーの設定

このトピックでは、Solr検索プロバイダーを手動で設定する方法を説明します。すでにSolrをインストールしていると仮定します。

SolrはオンプレミスインストールのxConnect検索のデフォルトの検索エンジンです。

> !注Sitecore Experience Platformはデフォルトで安全です。したがって、[SolrではSSL](https://cwiki.apache.org/confluence/display/solr/Enabling+SSL)を有効にする必要があります。

## Solrコアの作成

新しいSolrコアを作成するには:

1.  *C:\\solr-8.1.1\\server\\solr\\configset\\\_default*フォルダからSolr \_default設定を2コピーします。コピーを*C:\\solr-8.1.1\\server\\solr*フォルダに入れます。
    
2.  例えば、コアの名前を と *\_rebuild*にリネームします。
    
    -   xdbcore
        
    -   xdbcore\_rebuild
        
        > !重要コアの一つに名前を付けなければならない *<custom\_name>\_rebuild*。
        
3.  Solrのウェブクライアント([https://localhost:89xx/](https://localhost:89xx/))を開き、**Core Admin**をクリックしてください。
    
4.  新しいSolrコアを2つ追加します。
    
5.  [Solr Schema API](https://lucene.apache.org/solr/guide/6_6/schema-api.html#SchemaAPI-ModifytheSchema)を使って、xconnect\\App\_data\\solrcommands\\schema.jsonファイルのスキーマ変更を両方のコアに適用してください。
    
    この例は、Solr Schema APIを使って変更を適用するPowerShellスクリプトを示しています:
    
    $pathToXdbSchemaFile="C:\\inetpub\\wwwroot\\<instance\_name>\_xconnect\\App\_Data\\solrcommands\\schema.json"
    $apiUrl="https://<host>:<port>/solr/<custom\_name>/schema"
    
    $requestBody = Get-Content $pathToXdbSchemaFile -Raw | ConvertFrom-Json | ConvertTo-Json
    System.Net.ServicePointManager::SecurityProtocol = System.Net.SecurityProtocolType::Tls12
    
    Invoke-WebRequest -Uri $apiUrl -ContentType "application/json" -Method Post -UseBasicParsing -Body $requestBody | ConvertFrom-Json | ConvertTo-Json
    
6.  これらの設定ファイルで、Solrに紐づけられたコア名を含むsolrCore接続文字列を指定する必要があります:
    
    -   xconnect\\App\_Config\\ConnectionStrings.config
    -   xconnect\\App\_data\\jobs\\continuous\\IndexWorker\\App\_config\\ConnectionStrings.config
    
    更新するノードはこんな感じです:
    
    <add name="solrCore" connectionString="https://<host>:<port>/solr/<custom\_name>"/>
    
    はコアの名前に置き換えなければなりません。