@@ -36,9 +36,13 @@ public interface IStringProperty : IProperty
3636 [ JsonProperty ( "ignore_above" ) ]
3737 int ? IgnoreAbove { get ; set ; }
3838
39- [ JsonProperty ( "position_offset_gap" ) ]
39+ [ JsonIgnore ]
40+ [ Obsolete ( "Scheduled to be removed in 5.0. Use PositionIncrementGap instead." ) ]
4041 int ? PositionOffsetGap { get ; set ; }
4142
43+ [ JsonProperty ( "position_increment_gap" ) ]
44+ int ? PositionIncrementGap { get ; set ; }
45+
4246 [ JsonProperty ( "fielddata" ) ]
4347 IStringFielddata Fielddata { get ; set ; }
4448 }
@@ -57,11 +61,14 @@ public StringProperty() : base("string") { }
5761 public string SearchAnalyzer { get ; set ; }
5862 public bool ? IncludeInAll { get ; set ; }
5963 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 ; }
6167 public IStringFielddata Fielddata { get ; set ; }
68+
6269 }
6370
64- public class StringPropertyDescriptor < T >
71+ public class StringPropertyDescriptor < T >
6572 : PropertyDescriptorBase < StringPropertyDescriptor < T > , IStringProperty , T > , IStringProperty
6673 where T : class
6774 {
@@ -75,7 +82,9 @@ public class StringPropertyDescriptor<T>
7582 string IStringProperty . SearchAnalyzer { get ; set ; }
7683 bool ? IStringProperty . IncludeInAll { get ; set ; }
7784 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 ; }
7988 IStringFielddata IStringProperty . Fielddata { get ; set ; }
8089
8190 public StringPropertyDescriptor ( ) : base ( "string" ) { }
@@ -105,9 +114,12 @@ public StringPropertyDescriptor() : base("string") { }
105114
106115 public StringPropertyDescriptor < T > IncludeInAll ( bool includeInAll = true ) => Assign ( a => a . IncludeInAll = includeInAll ) ;
107116
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 ) ;
109121
110122 public StringPropertyDescriptor < T > Fielddata ( Func < StringFielddataDescriptor , IStringFielddata > selector ) =>
111123 Assign ( a => a . Fielddata = selector ? . Invoke ( new StringFielddataDescriptor ( ) ) ) ;
112124 }
113- }
125+ }
0 commit comments