Skip to content

Commit cdebd99

Browse files
committed
marked some of the removed queries as obsolete
1 parent c5f6aea commit cdebd99

File tree

6 files changed

+16
-0
lines changed

6 files changed

+16
-0
lines changed

src/Nest/DSL/HighlightFieldDescriptor.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public class HighlightFieldDescriptor<T> where T : class
4848
[JsonProperty("type")]
4949
internal string _Type { get; set; }
5050

51+
[JsonProperty("force_source")]
52+
internal bool? _ForceSource { get; set; }
53+
5154
public HighlightFieldDescriptor<T> OnField(string field)
5255
{
5356
this._Field = field;
@@ -67,6 +70,11 @@ public HighlightFieldDescriptor<T> TagsSchema(string schema = "styled")
6770
this._TagsSchema = schema;
6871
return this;
6972
}
73+
public HighlightFieldDescriptor<T> ForceSource(bool force = true)
74+
{
75+
this._ForceSource = force;
76+
return this;
77+
}
7078
public HighlightFieldDescriptor<T> Type(string type)
7179
{
7280
this._Type = type;

src/Nest/DSL/IQueryDescriptor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ interface IQueryDescriptor<T>
88
BaseQuery Bool(Action<BoolQueryDescriptor<T>> booleanQuery);
99
BaseQuery Boosting(Action<BoostingQueryDescriptor<T>> boostingQuery);
1010
BaseQuery ConstantScore(Action<ConstantScoreQueryDescriptor<T>> selector);
11+
[Obsolete("Custom boost factor has been removed in 1.1")]
1112
BaseQuery CustomBoostFactor(Action<CustomBoostFactorQueryDescriptor<T>> selector);
13+
[Obsolete("Custom score has been removed in 1.1")]
1214
BaseQuery CustomScore(Action<CustomScoreQueryDescriptor<T>> customScoreQuery);
1315
BaseQuery Dismax(Action<DismaxQueryDescriptor<T>> selector);
1416
BaseQuery Filtered(Action<FilteredQueryDescriptor<T>> selector);

src/Nest/DSL/QueryDescriptor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ public BaseQuery ConstantScore(Action<ConstantScoreQueryDescriptor<T>> selector)
493493
/// This can sometimes be desired since boost value set on specific queries gets normalized, while this
494494
/// query boost factor does not.
495495
/// </summary>
496+
[Obsolete("Custom boost factor has been removed in 1.1")]
496497
public BaseQuery CustomBoostFactor(Action<CustomBoostFactorQueryDescriptor<T>> selector)
497498
{
498499
var query = new CustomBoostFactorQueryDescriptor<T>();
@@ -504,6 +505,7 @@ public BaseQuery CustomBoostFactor(Action<CustomBoostFactorQueryDescriptor<T>> s
504505
/// custom_score query allows to wrap another query and customize the scoring of it optionally with a
505506
/// computation derived from other field values in the doc (numeric ones) using script expression
506507
/// </summary>
508+
[Obsolete("Custom score has been removed in 1.1")]
507509
public BaseQuery CustomScore(Action<CustomScoreQueryDescriptor<T>> customScoreQuery)
508510
{
509511
var query = new CustomScoreQueryDescriptor<T>();

src/Nest/Domain/DSL/Query.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ public static BaseQuery ConstantScore(Action<ConstantScoreQueryDescriptor<T>> se
3333
return new QueryDescriptor<T>().ConstantScore(selector);
3434
}
3535

36+
[Obsolete("Custom boost factor has been removed in 1.1")]
3637
public static BaseQuery CustomBoostFactor(Action<CustomBoostFactorQueryDescriptor<T>> selector)
3738
{
3839
return new QueryDescriptor<T>().CustomBoostFactor(selector);
3940
}
4041

42+
[Obsolete("Custom score has been removed in 1.1")]
4143
public static BaseQuery CustomScore(Action<CustomScoreQueryDescriptor<T>> customScoreQuery)
4244
{
4345
return new QueryDescriptor<T>().CustomScore(customScoreQuery);

src/Tests/Nest.Tests.Integration/Integration/HighlightTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public void TestHighlight()
2828
.OnField(e => e.Content)
2929
.PreTags("<em>")
3030
.PostTags("</em>")
31+
3132
)
3233
)
3334
);

src/Tests/Nest.Tests.Unit/Core/Map/FluentMappingFullExampleTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public void MapFluentFull()
125125
)
126126
.String(s => s
127127
.Name(p => p.Name)
128+
128129
.IndexName("my_crazy_name_i_want_in_lucene")
129130
.IncludeInAll()
130131
.Index(FieldIndexOption.analyzed)

0 commit comments

Comments
 (0)