private void Load()
{
this._configXML = new XmlDocument();
this._configXML.Load(FileHelper.ConfigFilePath);
XmlNodeList fieldProperties = this._configXML.GetElementsByTagName("field");
int index = 0;
foreach (XmlNode fieldProperty in fieldProperties)
{
if (!fieldProperty.Attributes.GetNamedItem("lucene_name").Value.Equals("Primarydata"))
{
SearchAttribute sa = new SearchAttribute();
sa.id = index;
//Names
if (fieldProperty.Attributes.GetNamedItem("display_name") != null)
sa.displayName = fieldProperty.Attributes.GetNamedItem("display_name").Value;
if (fieldProperty.Attributes.GetNamedItem("lucene_name") != null)
sa.sourceName = fieldProperty.Attributes.GetNamedItem("lucene_name").Value;
if (fieldProperty.Attributes.GetNamedItem("metadata_name") != null)
sa.metadataName = fieldProperty.Attributes.GetNamedItem("metadata_name").Value;
//types
if (fieldProperty.Attributes.GetNamedItem("type") != null)
sa.searchType = SearchAttribute.GetSearchType(fieldProperty.Attributes.GetNamedItem("type").Value);
if (fieldProperty.Attributes.GetNamedItem("primitive_type") != null)
sa.dataType = SearchAttribute.GetDataType(fieldProperty.Attributes.GetNamedItem("primitive_type").Value);
//// parameter for index
if (fieldProperty.Attributes.GetNamedItem("store") != null)
sa.store = SearchAttribute.GetBoolean(fieldProperty.Attributes.GetNamedItem("store").Value);
if (fieldProperty.Attributes.GetNamedItem("multivalued") != null)
sa.multiValue = SearchAttribute.GetBoolean(fieldProperty.Attributes.GetNamedItem("multivalued").Value);
if (fieldProperty.Attributes.GetNamedItem("analyzed") != null)
sa.analysed = SearchAttribute.GetBoolean(fieldProperty.Attributes.GetNamedItem("analyzed").Value);
if (fieldProperty.Attributes.GetNamedItem("norm") != null)
sa.norm = SearchAttribute.GetBoolean(fieldProperty.Attributes.GetNamedItem("norm").Value);
if (fieldProperty.Attributes.GetNamedItem("boost") != null)
sa.boost = Convert.ToDouble(fieldProperty.Attributes.GetNamedItem("boost").Value);
// Resultview
if (fieldProperty.Attributes.GetNamedItem("header_item") != null)
sa.headerItem = SearchAttribute.GetBoolean(fieldProperty.Attributes.GetNamedItem("header_item").Value);
if (fieldProperty.Attributes.GetNamedItem("default_visible_item") != null)
sa.defaultHeaderItem = SearchAttribute.GetBoolean(fieldProperty.Attributes.GetNamedItem("default_visible_item").Value);
if (fieldProperty.Attributes.GetNamedItem("direction") != null)
sa.direction = SearchAttribute.GetDirection(fieldProperty.Attributes.GetNamedItem("direction").Value);
if (fieldProperty.Attributes.GetNamedItem("uiComponent") != null)
sa.uiComponent = SearchAttribute.GetUIComponent(fieldProperty.Attributes.GetNamedItem("uiComponent").Value);
if (fieldProperty.Attributes.GetNamedItem("aggregationType") != null)
sa.aggregationType = SearchAttribute.GetAggregationType(fieldProperty.Attributes.GetNamedItem("aggregationType").Value);
if (fieldProperty.Attributes.GetNamedItem("date_format") != null)
sa.dateFormat = fieldProperty.Attributes.GetNamedItem("date_format").Value;
this._searchAttributeList.Add(sa);
index++;
}
else
{
this._includePrimaryData = true;
}
}
}