Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Sitecore;
Expand Down Expand Up @@ -28,13 +29,14 @@ public SynthesisSolrFieldNameTranslator(SolrFieldMap solrFieldMap, SolrIndexSche
}


public override string GetIndexFieldName(string fieldName)
{
if (_schema != null && (_schema.FindSolrFieldByName(fieldName) != null || _schema.SolrDynamicFields.Any(x => fieldName.EndsWith(x.Name.Substring(1)))))
return fieldName;
//at this point we can't be sure what type the data is in the field, our best bet would be a text field.
return AppendSolrText(fieldName);
}
public override string GetIndexFieldName(string fieldName)
{
if (_schema != null && (_schema.FindSolrFieldByName(fieldName) != null || _schema.SolrDynamicFields.Any(x => fieldName.EndsWith(x.Name.Substring(1)))))
return fieldName;

// Let default Sitecore API try to resolve it
return base.GetIndexFieldName(fieldName, (CultureInfo)null);
}

public override string GetIndexFieldName(MemberInfo member)
{
Expand Down Expand Up @@ -64,12 +66,12 @@ protected virtual string PreProcessSynthesisFieldName(string fieldName)
/// <param name="fieldName">the initial field name</param>
/// <returns>field name with a dynamic field identifier on it</returns>
private string AppendSolrText(string fieldName)
{
if (Context.Site == null || Context.Language.Name == Context.Site.Language)
fieldName += "_t";
else
fieldName += "_t_" + Context.Language;
return fieldName;
}
}
{
if (Context.Site == null || Context.Language.Name == Context.Site.Language)
fieldName += "_t";
else
fieldName += "_t_" + Context.Language;
return fieldName;
}
}
}