Skip to content

Commit 21561e6

Browse files
gmarzMpdreamz
authored andcommitted
Remove obsolete IndexName from mapping properties (#2305)
Closes #2293
1 parent 8267836 commit 21561e6

File tree

7 files changed

+1
-22
lines changed

7 files changed

+1
-22
lines changed

src/Nest/Mapping/AttributeBased/ElasticsearchPropertyAttributeBase.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ public abstract class ElasticsearchPropertyAttributeBase : Attribute, IProperty,
1414

1515
PropertyName IProperty.Name { get; set; }
1616
TypeName IProperty.Type { get; set; }
17-
string IProperty.IndexName { get; set; }
1817

1918
public string Name { get; set; }
2019
public bool Ignore { get; set; }
21-
public string IndexName { get { return Self.IndexName; } set { Self.IndexName = value; } }
2220

2321
protected ElasticsearchPropertyAttributeBase(string typeName)
2422
{

src/Nest/Mapping/Types/PropertyBase.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ public interface IProperty : IFieldMapping
1111

1212
[JsonProperty("type")]
1313
TypeName Type { get; set; }
14-
15-
[JsonProperty("index_name")]
16-
string IndexName { get; set; }
1714
}
1815

1916
public interface IPropertyWithClrOrigin
@@ -30,7 +27,6 @@ protected PropertyBase(TypeName typeName)
3027

3128
public PropertyName Name { get; set; }
3229
public virtual TypeName Type { get; set; }
33-
public string IndexName { get; set; }
3430
PropertyInfo IPropertyWithClrOrigin.ClrOrigin { get; set; }
3531
}
3632
}

src/Nest/Mapping/Types/PropertyDescriptorBase.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ public abstract class PropertyDescriptorBase<TDescriptor, TInterface, T>
1111
{
1212
PropertyName IProperty.Name { get; set; }
1313
TypeName IProperty.Type { get; set; }
14-
string IProperty.IndexName { get; set; }
1514

1615
protected PropertyDescriptorBase(string type) { Self.Type = type; }
1716

1817
public TDescriptor Name(PropertyName name) => Assign(a => a.Name = name);
1918

2019
public TDescriptor Name(Expression<Func<T, object>> objectPath) => Assign(a => a.Name = objectPath);
21-
22-
public TDescriptor IndexName(string indexName) => Assign(a => a.IndexName = indexName);
2320
}
24-
}
21+
}

src/Tests/Mapping/Types/Core/Binary/BinaryMappingTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public class BinaryTest
77
{
88
[Binary(
99
DocValues = true,
10-
IndexName = "myindex",
1110
Similarity = "classic",
1211
Store = true)]
1312
public string Full { get; set; }
@@ -26,7 +25,6 @@ public class BinaryMappingTests : TypeMappingTestBase<BinaryTest>
2625
{
2726
type = "binary",
2827
doc_values = true,
29-
index_name = "myindex",
3028
similarity = "classic",
3129
store = true
3230
},
@@ -41,7 +39,6 @@ public class BinaryMappingTests : TypeMappingTestBase<BinaryTest>
4139
.Binary(s => s
4240
.Name(o => o.Full)
4341
.DocValues()
44-
.IndexName("myindex")
4542
.Similarity(SimilarityOption.Classic)
4643
.Store()
4744
)

src/Tests/Mapping/Types/Core/Boolean/BooleanMappingTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public class BooleanTest
77
{
88
[Boolean(
99
DocValues = false,
10-
IndexName = "myindex",
1110
Similarity = "BM25",
1211
Index = false,
1312
Store = true)]
@@ -27,7 +26,6 @@ public class BooleanMappingTests : TypeMappingTestBase<BooleanTest>
2726
{
2827
type = "boolean",
2928
doc_values = false,
30-
index_name = "myindex",
3129
similarity = "BM25",
3230
store = true,
3331
index = false,
@@ -43,7 +41,6 @@ public class BooleanMappingTests : TypeMappingTestBase<BooleanTest>
4341
.Boolean(s => s
4442
.Name(o => o.Full)
4543
.DocValues(false)
46-
.IndexName("myindex")
4744
.Similarity(SimilarityOption.BM25)
4845
.Index(false)
4946
.Store(true)

src/Tests/Mapping/Types/Core/Date/DateMappingTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public class DateTest
77
{
88
[Date(
99
DocValues = true,
10-
IndexName = "myindex",
1110
Similarity = "classic",
1211
Store = true,
1312
Index = false,
@@ -37,7 +36,6 @@ public class DateMappingTests : TypeMappingTestBase<DateTest>
3736
{
3837
type = "date",
3938
doc_values = true,
40-
index_name = "myindex",
4139
similarity = "classic",
4240
store = true,
4341
index = false,
@@ -67,7 +65,6 @@ public class DateMappingTests : TypeMappingTestBase<DateTest>
6765
.Date(d => d
6866
.Name(o => o.Full)
6967
.DocValues()
70-
.IndexName("myindex")
7168
.Similarity(SimilarityOption.Classic)
7269
.Store()
7370
.Index(false)

src/Tests/Mapping/Types/Core/Number/NumberMappingTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public class NumberTest
77
{
88
[Number(
99
DocValues = true,
10-
IndexName = "myindex",
1110
Similarity = "classic",
1211
Store = true,
1312
Index = false,
@@ -58,7 +57,6 @@ public class NumberMappingTests
5857
{
5958
type = "float",
6059
doc_values = true,
61-
index_name = "myindex",
6260
similarity = "classic",
6361
store = true,
6462
index = false,
@@ -128,7 +126,6 @@ public class NumberMappingTests
128126
.Number(d => d
129127
.Name(o => o.Full)
130128
.DocValues()
131-
.IndexName("myindex")
132129
.Similarity(SimilarityOption.Classic)
133130
.Store()
134131
.Index(false)

0 commit comments

Comments
 (0)