From dde8fed234efe9a96e32b31559a81bcb1ad1ce99 Mon Sep 17 00:00:00 2001 From: Greg Marzouka Date: Fri, 30 Sep 2016 16:32:27 -0400 Subject: [PATCH] Remove obsolete IndexName from mapping properties Closes #2293 --- .../AttributeBased/ElasticsearchPropertyAttributeBase.cs | 2 -- src/Nest/Mapping/Types/PropertyBase.cs | 4 ---- src/Nest/Mapping/Types/PropertyDescriptorBase.cs | 5 +---- src/Tests/Mapping/Types/Core/Binary/BinaryMappingTests.cs | 3 --- src/Tests/Mapping/Types/Core/Boolean/BooleanMappingTests.cs | 3 --- src/Tests/Mapping/Types/Core/Date/DateMappingTests.cs | 3 --- src/Tests/Mapping/Types/Core/Number/NumberMappingTests.cs | 3 --- 7 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/Nest/Mapping/AttributeBased/ElasticsearchPropertyAttributeBase.cs b/src/Nest/Mapping/AttributeBased/ElasticsearchPropertyAttributeBase.cs index 83e07d1ed50..79402c62ff1 100644 --- a/src/Nest/Mapping/AttributeBased/ElasticsearchPropertyAttributeBase.cs +++ b/src/Nest/Mapping/AttributeBased/ElasticsearchPropertyAttributeBase.cs @@ -14,11 +14,9 @@ public abstract class ElasticsearchPropertyAttributeBase : Attribute, IProperty, PropertyName IProperty.Name { get; set; } TypeName IProperty.Type { get; set; } - string IProperty.IndexName { get; set; } public string Name { get; set; } public bool Ignore { get; set; } - public string IndexName { get { return Self.IndexName; } set { Self.IndexName = value; } } protected ElasticsearchPropertyAttributeBase(string typeName) { diff --git a/src/Nest/Mapping/Types/PropertyBase.cs b/src/Nest/Mapping/Types/PropertyBase.cs index f21b5d94e93..eafda63980a 100644 --- a/src/Nest/Mapping/Types/PropertyBase.cs +++ b/src/Nest/Mapping/Types/PropertyBase.cs @@ -11,9 +11,6 @@ public interface IProperty : IFieldMapping [JsonProperty("type")] TypeName Type { get; set; } - - [JsonProperty("index_name")] - string IndexName { get; set; } } public interface IPropertyWithClrOrigin @@ -30,7 +27,6 @@ protected PropertyBase(TypeName typeName) public PropertyName Name { get; set; } public virtual TypeName Type { get; set; } - public string IndexName { get; set; } PropertyInfo IPropertyWithClrOrigin.ClrOrigin { get; set; } } } diff --git a/src/Nest/Mapping/Types/PropertyDescriptorBase.cs b/src/Nest/Mapping/Types/PropertyDescriptorBase.cs index d3a510ebb33..b719abd569e 100644 --- a/src/Nest/Mapping/Types/PropertyDescriptorBase.cs +++ b/src/Nest/Mapping/Types/PropertyDescriptorBase.cs @@ -11,14 +11,11 @@ public abstract class PropertyDescriptorBase { PropertyName IProperty.Name { get; set; } TypeName IProperty.Type { get; set; } - string IProperty.IndexName { get; set; } protected PropertyDescriptorBase(string type) { Self.Type = type; } public TDescriptor Name(PropertyName name) => Assign(a => a.Name = name); public TDescriptor Name(Expression> objectPath) => Assign(a => a.Name = objectPath); - - public TDescriptor IndexName(string indexName) => Assign(a => a.IndexName = indexName); } -} \ No newline at end of file +} diff --git a/src/Tests/Mapping/Types/Core/Binary/BinaryMappingTests.cs b/src/Tests/Mapping/Types/Core/Binary/BinaryMappingTests.cs index 02d37866397..ecf23a347dd 100644 --- a/src/Tests/Mapping/Types/Core/Binary/BinaryMappingTests.cs +++ b/src/Tests/Mapping/Types/Core/Binary/BinaryMappingTests.cs @@ -7,7 +7,6 @@ public class BinaryTest { [Binary( DocValues = true, - IndexName = "myindex", Similarity = "classic", Store = true)] public string Full { get; set; } @@ -26,7 +25,6 @@ public class BinaryMappingTests : TypeMappingTestBase { type = "binary", doc_values = true, - index_name = "myindex", similarity = "classic", store = true }, @@ -41,7 +39,6 @@ public class BinaryMappingTests : TypeMappingTestBase .Binary(s => s .Name(o => o.Full) .DocValues() - .IndexName("myindex") .Similarity(SimilarityOption.Classic) .Store() ) diff --git a/src/Tests/Mapping/Types/Core/Boolean/BooleanMappingTests.cs b/src/Tests/Mapping/Types/Core/Boolean/BooleanMappingTests.cs index 3fee8345ff1..092e28cc168 100644 --- a/src/Tests/Mapping/Types/Core/Boolean/BooleanMappingTests.cs +++ b/src/Tests/Mapping/Types/Core/Boolean/BooleanMappingTests.cs @@ -7,7 +7,6 @@ public class BooleanTest { [Boolean( DocValues = false, - IndexName = "myindex", Similarity = "BM25", Index = false, Store = true)] @@ -27,7 +26,6 @@ public class BooleanMappingTests : TypeMappingTestBase { type = "boolean", doc_values = false, - index_name = "myindex", similarity = "BM25", store = true, index = false, @@ -43,7 +41,6 @@ public class BooleanMappingTests : TypeMappingTestBase .Boolean(s => s .Name(o => o.Full) .DocValues(false) - .IndexName("myindex") .Similarity(SimilarityOption.BM25) .Index(false) .Store(true) diff --git a/src/Tests/Mapping/Types/Core/Date/DateMappingTests.cs b/src/Tests/Mapping/Types/Core/Date/DateMappingTests.cs index 692bdac39a4..29d75e2277c 100644 --- a/src/Tests/Mapping/Types/Core/Date/DateMappingTests.cs +++ b/src/Tests/Mapping/Types/Core/Date/DateMappingTests.cs @@ -7,7 +7,6 @@ public class DateTest { [Date( DocValues = true, - IndexName = "myindex", Similarity = "classic", Store = true, Index = false, @@ -37,7 +36,6 @@ public class DateMappingTests : TypeMappingTestBase { type = "date", doc_values = true, - index_name = "myindex", similarity = "classic", store = true, index = false, @@ -67,7 +65,6 @@ public class DateMappingTests : TypeMappingTestBase .Date(d => d .Name(o => o.Full) .DocValues() - .IndexName("myindex") .Similarity(SimilarityOption.Classic) .Store() .Index(false) diff --git a/src/Tests/Mapping/Types/Core/Number/NumberMappingTests.cs b/src/Tests/Mapping/Types/Core/Number/NumberMappingTests.cs index 6a00674a2cf..967dab1d7df 100644 --- a/src/Tests/Mapping/Types/Core/Number/NumberMappingTests.cs +++ b/src/Tests/Mapping/Types/Core/Number/NumberMappingTests.cs @@ -7,7 +7,6 @@ public class NumberTest { [Number( DocValues = true, - IndexName = "myindex", Similarity = "classic", Store = true, Index = false, @@ -58,7 +57,6 @@ public class NumberMappingTests { type = "float", doc_values = true, - index_name = "myindex", similarity = "classic", store = true, index = false, @@ -128,7 +126,6 @@ public class NumberMappingTests .Number(d => d .Name(o => o.Full) .DocValues() - .IndexName("myindex") .Similarity(SimilarityOption.Classic) .Store() .Index(false)