Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Sitecore Solr查询:字段名翻译区域性问题_C#_Solr_Sitecore - Fatal编程技术网

C# Sitecore 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*) 返回

我想知道是否有任何方法可以强制FieldNameTranslator将语言附加到字段名

query=context.GetQueryablei=>i[context.Index.fieldnametransplator.getIndexFieldName目录号].Containsm0202; 上面的代码将转换为solr查询:

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);