@@ -36,9 +36,13 @@ public interface IStringProperty : IProperty
36
36
[ JsonProperty ( "ignore_above" ) ]
37
37
int ? IgnoreAbove { get ; set ; }
38
38
39
- [ JsonProperty ( "position_offset_gap" ) ]
39
+ [ JsonIgnore ]
40
+ [ Obsolete ( "Scheduled to be removed in 5.0. Use PositionIncrementGap instead." ) ]
40
41
int ? PositionOffsetGap { get ; set ; }
41
42
43
+ [ JsonProperty ( "position_increment_gap" ) ]
44
+ int ? PositionIncrementGap { get ; set ; }
45
+
42
46
[ JsonProperty ( "fielddata" ) ]
43
47
IStringFielddata Fielddata { get ; set ; }
44
48
}
@@ -57,11 +61,14 @@ public StringProperty() : base("string") { }
57
61
public string SearchAnalyzer { get ; set ; }
58
62
public bool ? IncludeInAll { get ; set ; }
59
63
public int ? IgnoreAbove { get ; set ; }
60
- public int ? PositionOffsetGap { get ; set ; }
64
+ [ Obsolete ( "Scheduled to be removed in 5.0. Use PositionIncrementGap instead." ) ]
65
+ public int ? PositionOffsetGap { get { return PositionIncrementGap ; } set { PositionIncrementGap = value ; } }
66
+ public int ? PositionIncrementGap { get ; set ; }
61
67
public IStringFielddata Fielddata { get ; set ; }
68
+
62
69
}
63
70
64
- public class StringPropertyDescriptor < T >
71
+ public class StringPropertyDescriptor < T >
65
72
: PropertyDescriptorBase < StringPropertyDescriptor < T > , IStringProperty , T > , IStringProperty
66
73
where T : class
67
74
{
@@ -75,7 +82,9 @@ public class StringPropertyDescriptor<T>
75
82
string IStringProperty . SearchAnalyzer { get ; set ; }
76
83
bool ? IStringProperty . IncludeInAll { get ; set ; }
77
84
int ? IStringProperty . IgnoreAbove { get ; set ; }
78
- int ? IStringProperty . PositionOffsetGap { get ; set ; }
85
+ [ Obsolete ( "Scheduled to be removed in 5.0. Use PositionIncrementGap instead." ) ]
86
+ int ? IStringProperty . PositionOffsetGap { get { return Self . PositionIncrementGap ; } set { Self . PositionIncrementGap = value ; } }
87
+ int ? IStringProperty . PositionIncrementGap { get ; set ; }
79
88
IStringFielddata IStringProperty . Fielddata { get ; set ; }
80
89
81
90
public StringPropertyDescriptor ( ) : base ( "string" ) { }
@@ -105,9 +114,12 @@ public StringPropertyDescriptor() : base("string") { }
105
114
106
115
public StringPropertyDescriptor < T > IncludeInAll ( bool includeInAll = true ) => Assign ( a => a . IncludeInAll = includeInAll ) ;
107
116
108
- public StringPropertyDescriptor < T > PositionOffsetGap ( int positionOffsetGap ) => Assign ( a => a . PositionOffsetGap = positionOffsetGap ) ;
117
+ [ Obsolete ( "Scheduled to be removed in 5.0. Use PositionIncrementGap() instead." ) ]
118
+ public StringPropertyDescriptor < T > PositionOffsetGap ( int positionOffsetGap ) => Assign ( a => a . PositionIncrementGap = positionOffsetGap ) ;
119
+
120
+ public StringPropertyDescriptor < T > PositionIncrementGap ( int ? positionIncrementGap ) => Assign ( a => a . PositionIncrementGap = positionIncrementGap ) ;
109
121
110
122
public StringPropertyDescriptor < T > Fielddata ( Func < StringFielddataDescriptor , IStringFielddata > selector ) =>
111
123
Assign ( a => a . Fielddata = selector ? . Invoke ( new StringFielddataDescriptor ( ) ) ) ;
112
124
}
113
- }
125
+ }
0 commit comments