C# Sitecore Solr查询:字段名翻译区域性问题
我想知道是否有任何方法可以强制FieldNameTranslator将语言附加到字段名 query=context.GetQueryablei=>i[context.Index.fieldnametransplator.getIndexFieldName目录号].Containsm0202; 上面的代码将转换为solr查询:C# Sitecore Solr查询:字段名翻译区域性问题,c#,solr,sitecore,C#,Solr,Sitecore,我想知道是否有任何方法可以强制FieldNameTranslator将语言附加到字段名 query=context.GetQueryablei=>i[context.Index.fieldnametransplator.getIndexFieldName目录号].Containsm0202; 上面的代码将转换为solr查询: https://localhost:8983/solr/sitecore_web_index/select?q=catalog_number_t:(*m0202*) 返回
https://localhost:8983/solr/sitecore_web_index/select?q=catalog_number_t:(*m0202*)
返回0个结果
如果我将_en附加到字段名:
https://localhost:8983/solr/sitecore_web_index/select?q=catalog_number_t_en:(*m0202*)
string SolrFieldNameTranslator.GetIndexFieldName(string fieldName, CultureInfo culture);
string SolrFieldNameTranslator.GetIndexFieldName(string fieldName, Type returnType, CultureInfo culture);
我得到了预期的结果
那么我如何通过代码添加它呢
甚至
context.Index.FieldNameTranslator.GetIndexFieldNamecatalog\u编号\u t\u en
返回目录号
目录号-sitecore中的单行文本字段。
我使用的是Sitecore 9.1 Update-1,Solr 7.2.1。如果在Solr索引中的不同字段名中存储了区域性语言版本,则可以使用以下重载之一将区域性附加到字段名的末尾:
https://localhost:8983/solr/sitecore_web_index/select?q=catalog_number_t_en:(*m0202*)
string SolrFieldNameTranslator.GetIndexFieldName(string fieldName, CultureInfo culture);
string SolrFieldNameTranslator.GetIndexFieldName(string fieldName, Type returnType, CultureInfo culture);