簡體   English   中英

使用Vulcan彈性搜索EPiServer映射錯誤

[英]Mapping errors using Vulcan elastic search for EPiServer

有沒有人使用過名為Vulcan的EPiServer的elasticsearch客戶端? https://github.com/TCB-Internet-Solutions/vulcan

通過所有帳戶(包括寫得很好的一個帳戶: https ://blog.wsol.com/getting-started-using-vulcan-search-in-episerver),它應該與安裝NuGet軟件包“ TcbInternetSolutions.Vulcan”一樣簡單。 EPiServer NuGet提要中的“ .Core”,添加web.config設置,並運行計划的作業以索引數據。

我將NuGet軟件包(版本3.0.1)安裝到我的EPiServer項目(版本11.2.1)中,並設置了web.config設置,索引作業報告“作業已完成。請刷新頁面以查看狀態。” 運行歷史記錄顯示“ Vulcan已成功在1個索引器中索引了100個項目!”。

但是,當我查看“ \\ App_Data \\ EPiServerErrors.log”文件時,看到大量錯誤,例如:

錯誤TcbInternetSolutions.Vulcan.Core.Implementation.VulcanClient:Vulcan無法使用內容鏈接10索引語言en的內容:System.Exception:無效的NEST響應是由對PUT的低級調用失敗所建立的:/customername_en/EPiServer.Core.BlockData/此API調用的10審核跟蹤:-[1] BadResponse:節點: http:// localhost:9200 /接收 :00:00:00.4026489 ServerError:ServerError:400Type:mapper_parsing_exception原因:“未能為以下項找到解析的[string]類型[contentAssetsID]“ OriginalException:System.Net.WebException:遠程服務器返回錯誤:(400)錯誤的請求。 在System.Net.HttpWebRequest.GetResponse()在Elasticsearch.Net.HttpConnection.Request [TReturn](RequestData requestData)在C:\\ Projects \\ elastic \\ net-2 \\ src \\ Elasticsearch.Net \\ Connection \\ HttpConnection.cs:line 163

似乎由於在“ [contentAssetsID]”為數字時所有內容到字符串的默認映射,因此無法在索引“ customername_en”中為類型“ EPiServer.Core.BlockData”建立索引。 因此,我嘗試添加一個初始化類以將映射設置為AutoMap:

[ModuleDependency(typeof(ServiceContainerInitialization))]
public class SearchInitialization : IConfigurableModule
{
    public void ConfigureContainer(ServiceConfigurationContext context)
    {
        // Nothing to do
    }

    public void Initialize(InitializationEngine context)
    {
        var vh = ServiceLocator.Current.GetInstance<VulcanHandler>();
        var vhClient = vh.GetClient(new System.Globalization.CultureInfo("en"));
        var res = vhClient.Map<EPiServer.Core.BlockData>(m => m.AutoMap());
    }

    public void Uninitialize(InitializationEngine context)
    {
        // Nothing to do
    }
}

“ res”返回成功的響應,但錯誤仍然發生。

此處有完整錯誤: https : //pastebin.com/T7NPgZj9

請幫忙!

感謝Dimitar,我使用的是ElasticSearch 5而不是2。更改為版本2后,它可以工作了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM