private attribute FacetAttribute(ConfigurationAttribute a)
        {
            if (!_facetDict.ContainsKey(a.Name))
            {
                return(null);
            }
            var fa = new ConfigurationAttribute(
                a.Name + "__facet",
                type.@string,
                Present.No,
                filterOptions: new FilterOptions(Format.PipeSeparated, Tokenization.None),
                sortOptions: new SortOptions(Normalization.CaseInsensitive));

            return(_attributeConverter.Convert(fa));
        }
        private void CreateAttribute(MetaFieldEx mf, IDictionary <string, ConfigurationAttribute> attributes)
        {
            var attrName  = mf.Name.ToLower();
            var navigable = IsNavigable(mf.Name);

            if (mf.AllowSearch || navigable)
            {
                ConfigurationAttribute existing;
                ConfigurationAttribute a;
                if (attributes.TryGetValue(attrName, out existing))
                {
                    attributes.Remove(attrName);

                    a = new ConfigurationAttribute(
                        existing.Name,
                        existing.Type,
                        existing.Present,
                        mf.AllowSearch
                            ? new SearchOptions(
                            existing.SearchOptions != null ? existing.SearchOptions.Locale : null,
                            existing.SearchOptions != null ? existing.SearchOptions.Format : Format.PipeSeparated,
                            existing.SearchOptions != null && existing.SearchOptions.MatchSuffix,
                            IsSuggestable(attrName))
                            : existing.SearchOptions,
                        existing.FilterOptions != null
                            ? new FilterOptions(existing.FilterOptions.Format, Tokenization.CaseInsensitive)
                            : null,
                        existing.SortOptions);
                }
                else
                {
                    var format = GetFormat(mf);
                    a = new ConfigurationAttribute(
                        attrName,
                        GetType(mf),
                        mf.Presentable ? Present.Yes : Present.No,
                        mf.AllowSearch ? new SearchOptions(null, format, false, IsSuggestable(attrName)) : null,
                        _appConfig.FilterAttributes.Contains(attrName) ? new FilterOptions(format, GetTokenization(mf)) : null,
                        new SortOptions(Normalization.CaseInsensitive));
                }
                attributes.Add(attrName, a);
            }
        }