Esempio n. 1
0
        private static string GetName(AutoIndexField x)
        {
            var name = x.Name;

            if (x.HasQuotedName)
            {
                name = $"'{name}'";
            }

            if (x.GroupByArrayBehavior == GroupByArrayBehavior.ByContent)
            {
                name = AutoIndexField.GetGroupByArrayContentAutoIndexFieldName(name).ToUpperFirstLetter();
            }

            if (x.Indexing == AutoFieldIndexing.Default || x.Indexing == AutoFieldIndexing.No)
            {
                if (x.Spatial != null)
                {
                    return(name
                           .Replace(",", "|")
                           .Replace(" ", string.Empty)
                           .ToUpperFirstLetter());
                }

                if (x.HasSuggestions)
                {
                    return(AutoIndexField.GetSuggestionsAutoIndexFieldName(name).ToUpperFirstLetter());
                }

                return(name);
            }

            var functions = new List <string>();

            if (x.Indexing.HasFlag(AutoFieldIndexing.Search))
            {
                functions.Add(AutoIndexField.GetSearchAutoIndexFieldName(name).ToUpperFirstLetter());
            }

            if (x.Indexing.HasFlag(AutoFieldIndexing.Highlighting))
            {
                functions.Add(AutoIndexField.GetHighlightingAutoIndexFieldName(name).ToUpperFirstLetter());
            }

            if (x.Indexing.HasFlag(AutoFieldIndexing.Exact))
            {
                functions.Add(AutoIndexField.GetExactAutoIndexFieldName(name).ToUpperFirstLetter());
            }

            if (x.HasSuggestions)
            {
                functions.Add(AutoIndexField.GetSuggestionsAutoIndexFieldName(name).ToUpperFirstLetter());
            }

            return(string.Join("And", functions));
        }
Esempio n. 2
0
        private static string GetName(AutoIndexField x)
        {
            if (x.Indexing == AutoFieldIndexing.Default || x.Indexing == AutoFieldIndexing.No)
            {
                return(x.Name);
            }

            var functions = new List <string>();

            if (x.Indexing.HasFlag(AutoFieldIndexing.Search))
            {
                functions.Add(AutoIndexField.GetSearchAutoIndexFieldName(x.Name).ToUpperFirstLetter());
            }

            if (x.Indexing.HasFlag(AutoFieldIndexing.Exact))
            {
                functions.Add(AutoIndexField.GetExactAutoIndexFieldName(x.Name).ToUpperFirstLetter());
            }

            return(string.Join("And", functions));
        }