Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete IndexName from mapping properties #2305

Merged
merged 1 commit into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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