---
title: "接続タイムアウトを指定する"
slug: "specify-connection-timeout"
abstract: "このトピックでは、Solrの接続タイムアウトをどのように異なる方法で指定できるかについて説明します。"
---
# 接続タイムアウトを指定する

SitecoreはSolrサーバーと連携し、インデックス操作、検索クエリの実行、Solrスキーマの管理、Solrコアの管理を行います。デフォルトでは、Sitecoreはリクエストの目的に関わらず、すべてのリクエストに対して同じタイムアウト構成を使用します。

しかし、目的が異なるリクエストの場合は、異なるリクエストタイムアウト値を持つことで恩恵を受けることがあります。例えば、Solrスキーマの更新やSolrコアプロパティの変更を求めるリクエストは稀なので、そのような操作に対してより長いタイムアウトが許容されます。一方で、Searchクエリはタイムアウトが長すぎるとシステム全体の性能を低下させる可能性があります。

したがって、3種類の異なる操作に対して異なる接続タイムアウト値を指定できます:

-   Admin:コアな管理操作に使用されます。これらの操作の全リストはSolrのウェブサイトでご覧いただけます。
-   クエリ:通常の検索クエリに使用されます。
-   デフォルト:上記のいずれかでない操作に使用されます。

異なる接続のタイムアウト値を有効化・指定するために。

1.  App\_Config\\Include\\Examples\\Sitecore.ContentSearch.Solr.ConnectionSettings.config.exampleファイルをApp\_Config\\Include\\Examples\\Sitecore.ContentSearch.Solr.ConnectionSettings.configにリネームしてください。
    
2.  admin、query、defaultに必要な値を(ミリ秒単位で)指定します。
    
    <sitecore search:require="solr">
    <contentSearch>
     <indexConfigurations>
    
     <!-- HTTP WEB REQUEST FACTORY
     Allows you to override the http web request factory. This factory class is responsible for creating IHttpWebRequest's.
     -->
     <solrHttpWebRequestFactory type="HttpWebAdapters.HttpWebRequestFactory, SolrNet" />
    
     <!-- SOLR CONNECTION CONFIGURATIONS
     Allows to configure connections to Solr which are used for different types of operations.
     -->
     <solrConnectionConfigurations>
    
     <!-- Connection configuration used for the CoreAdmin operations. -->
     <solrConnectionConfiguration name="admin">
     <timeout>0</timeout>
     <!-- This connection type requires the 'usePost' element is set to 'false'. -->
     <usePost>false</usePost>
     </solrConnectionConfiguration>
    
     <!-- Connection configuration used for the Query operations. -->
     <solrConnectionConfiguration name="query">
     <timeout>0</timeout>
     <usePost>false</usePost>
     </solrConnectionConfiguration>
    
     <!-- Connection configuration used for the rest of operations. -->
     <solrConnectionConfiguration name="default">
     <timeout>0</timeout>
     <!-- This connection type requires the 'usePost' element is set to 'false'. -->
     <usePost>false</usePost>
     </solrConnectionConfiguration>
     </solrConnectionConfigurations>
     </indexConfigurations>
    </contentSearch>
    </sitecore>