Skip to content

Commit

Permalink
Remove obsolete IndexName from mapping properties
Browse files Browse the repository at this point in the history
Closes #2293
  • Loading branch information
gmarz committed Sep 30, 2016
1 parent 9aee38a commit 7312a17
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Nest/Mapping/Types/PropertyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public interface IProperty : IFieldMapping

[JsonProperty("type")]
TypeName Type { get; set; }

[JsonProperty("index_name")]
string IndexName { get; set; }
}

public interface IPropertyWithClrOrigin
Expand All @@ -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; }
}
}
5 changes: 1 addition & 4 deletions src/Nest/Mapping/Types/PropertyDescriptorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ public abstract class PropertyDescriptorBase<TDescriptor, TInterface, T>
{
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<Func<T, object>> objectPath) => Assign(a => a.Name = objectPath);

public TDescriptor IndexName(string indexName) => Assign(a => a.IndexName = indexName);
}
}
}
3 changes: 0 additions & 3 deletions src/Tests/Mapping/Types/Core/Binary/BinaryMappingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class BinaryTest
{
[Binary(
DocValues = true,
IndexName = "myindex",
Similarity = "classic",
Store = true)]
public string Full { get; set; }
Expand All @@ -26,7 +25,6 @@ public class BinaryMappingTests : TypeMappingTestBase<BinaryTest>
{
type = "binary",
doc_values = true,
index_name = "myindex",
similarity = "classic",
store = true
},
Expand All @@ -41,7 +39,6 @@ public class BinaryMappingTests : TypeMappingTestBase<BinaryTest>
.Binary(s => s
.Name(o => o.Full)
.DocValues()
.IndexName("myindex")
.Similarity(SimilarityOption.Classic)
.Store()
)
Expand Down
3 changes: 0 additions & 3 deletions src/Tests/Mapping/Types/Core/Boolean/BooleanMappingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class BooleanTest
{
[Boolean(
DocValues = false,
IndexName = "myindex",
Similarity = "BM25",
Index = false,
Store = true)]
Expand All @@ -27,7 +26,6 @@ public class BooleanMappingTests : TypeMappingTestBase<BooleanTest>
{
type = "boolean",
doc_values = false,
index_name = "myindex",
similarity = "BM25",
store = true,
index = false,
Expand All @@ -43,7 +41,6 @@ public class BooleanMappingTests : TypeMappingTestBase<BooleanTest>
.Boolean(s => s
.Name(o => o.Full)
.DocValues(false)
.IndexName("myindex")
.Similarity(SimilarityOption.BM25)
.Index(false)
.Store(true)
Expand Down
3 changes: 0 additions & 3 deletions src/Tests/Mapping/Types/Core/Date/DateMappingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class DateTest
{
[Date(
DocValues = true,
IndexName = "myindex",
Similarity = "classic",
Store = true,
Index = false,
Expand Down Expand Up @@ -37,7 +36,6 @@ public class DateMappingTests : TypeMappingTestBase<DateTest>
{
type = "date",
doc_values = true,
index_name = "myindex",
similarity = "classic",
store = true,
index = false,
Expand Down Expand Up @@ -67,7 +65,6 @@ public class DateMappingTests : TypeMappingTestBase<DateTest>
.Date(d => d
.Name(o => o.Full)
.DocValues()
.IndexName("myindex")
.Similarity(SimilarityOption.Classic)
.Store()
.Index(false)
Expand Down
3 changes: 0 additions & 3 deletions src/Tests/Mapping/Types/Core/Number/NumberMappingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class NumberTest
{
[Number(
DocValues = true,
IndexName = "myindex",
Similarity = "classic",
Store = true,
Index = false,
Expand Down Expand Up @@ -58,7 +57,6 @@ public class NumberMappingTests
{
type = "float",
doc_values = true,
index_name = "myindex",
similarity = "classic",
store = true,
index = false,
Expand Down Expand Up @@ -128,7 +126,6 @@ public class NumberMappingTests
.Number(d => d
.Name(o => o.Full)
.DocValues()
.IndexName("myindex")
.Similarity(SimilarityOption.Classic)
.Store()
.Index(false)
Expand Down

0 comments on commit 7312a17

Please sign in to comment.