Код: Выделить всё
var addResponse = solr.AddRange(dictDocumentIdList);
Shared.Log.Info($"Document Indexed Status:{addResponse.Status},time:; {addResponse.QTime}");
try
{
Shared.Log.Info("Before Commit");
var commitResponse = solr.Commit();
Shared.Log.Info("After Commit");
}
catch (Exception exc)
{
Shared.Log.Error("Failed to commit indexing",exc);
}
< /code>
ошибка: < /p>
The operation has timed out,(:0)
SolrNet.Exceptions.SolrConnectionException: The operation has timed out ---> System.Net.WebException: The operation has timed out
at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()
at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request)
at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters)
--- End of inner exception stack trace ---
at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters)
at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s)
at SolrNet.Impl.LowLevelSolrServer.SendAndParseHeader(ISolrCommand cmd)
at Indexing.Business.IndexingWorker.NewLogicIndexRecordsAndUpdateTables(HardwareDetail hardwareDetail, CoreDetail coreDetail, String documentIdLst, Boolean isUpdateIndexingRetryStatus, Int32 dataPointId)
< /code>
Я не сталкиваюсь с какой -либо проблемой при вставке с использованием приведенного ниже API Call: < /p>
URL = $"http://{hardwareDetail.HardwareName}:{hardwareDetail.Port}/solr/{coreName}/dataimport?command=full-import&commit=true&clean=false&optimize=true";
< /code>
Я попытался установить тайм -аут на -1 в Solr init, но все еще столкнулся с этой ошибкой < /p>
private void InitSolr(HardwareDetail hardwareDetail,CoreDetail coreDetail)
{
try
{
// Remove previous initialization and add new core init
string solrUrl = $"http://{hardwareDetail.HardwareName}:{hardwareDetail.Port}/solr/{coreDetail.CoreName}";
Shared.Log.Debug($"Initializing solr connection for core: {coreDetail.CoreName}");
Startup.Container.Clear();
Startup.InitContainer();
Startup.Init(new SolrConnection(solrUrl)
{
Timeout = -1
});
Shared.Log.Debug($"Index Core called using solr wrapper.");
}
catch (Exception ex)
{
Shared.Log.Error($"Failed to initialize Solr core {coreDetail.CoreName}: {ex.Message}");
throw;
}
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... et-wrapper