Ejemplo n.º 1
0
        /// <summary>
        /// Remove the default values that we don't actually need
        /// </summary>
        public void RemoveDefaultValues()
        {
            var defaultStorage = IsMapReduce ? FieldStorage.Yes : FieldStorage.No;

            foreach (var toRemove in Stores.Where(x => x.Value == defaultStorage).ToArray())
            {
                Stores.Remove(toRemove);
            }
            foreach (var toRemove in Indexes.Where(x => x.Value == FieldIndexing.Default).ToArray())
            {
                Indexes.Remove(toRemove);
            }
            foreach (var toRemove in SortOptions.Where(x => x.Value == Indexing.SortOptions.None).ToArray())
            {
                SortOptions.Remove(toRemove);
            }
            foreach (var toRemove in Analyzers.Where(x => string.IsNullOrEmpty(x.Value)).ToArray())
            {
                Analyzers.Remove(toRemove);
            }
            foreach (var toRemove in Suggestions.Where(x => x.Value.Distance == StringDistanceTypes.None).ToArray())
            {
                Suggestions.Remove(toRemove);
            }
            foreach (var toRemove in TermVectors.Where(x => x.Value == FieldTermVector.No).ToArray())
            {
                TermVectors.Remove(toRemove);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Remove the default values that we don't actually need
        /// </summary>
        public void RemoveDefaultValues()
        {
            const FieldStorage defaultStorage = FieldStorage.No;

            foreach (var toRemove in Stores.Where(x => x.Value == defaultStorage).ToArray())
            {
                Stores.Remove(toRemove);
            }
            foreach (var toRemove in Indexes.Where(x => x.Value == FieldIndexing.Default).ToArray())
            {
                Indexes.Remove(toRemove);
            }
            foreach (var toRemove in SortOptions.Where(x => x.Value == Indexing.SortOptions.None).ToArray())
            {
                SortOptions.Remove(toRemove);
            }
            foreach (var toRemove in Analyzers.Where(x => string.IsNullOrEmpty(x.Value)).ToArray())
            {
                Analyzers.Remove(toRemove);
            }
            foreach (var toRemove in TermVectors.Where(x => x.Value == FieldTermVector.No).ToArray())
            {
                TermVectors.Remove(toRemove);
            }
        }