【发布时间】:2019-05-10 18:50:12
【问题描述】:
我想知道是否有强制 FieldNameTranslator 将语言附加到字段名称。
query = context.GetQueryable<SearchResultItem>(i => i[context.Index.FieldNameTranslator.GetIndexFieldName("Catalog Number")].Contains("m0202"));
上面的代码变成了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*)
我得到了预期的结果。
那么如何通过代码添加呢?
偶数
context.Index.FieldNameTranslator.GetIndexFieldName("catalog_number_t_en")
返回 catalog_number_t
目录编号 - sitecore 中的单行文本字段。 我正在使用 Sitecore 9.1 Update-1、Solr 7.2.1。
【问题讨论】: