Skip to content

Commit 5dde64d

Browse files
russcamMpdreamz
authored andcommitted
Mark ttl and timestamp as deprecated
Update documentation to indicate deprecation See #1988
1 parent 0774997 commit 5dde64d

File tree

8 files changed

+95
-58
lines changed

8 files changed

+95
-58
lines changed

Diff for: docs/asciidoc/query-dsl/compound/and/and-query-usage.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
[[and-query-usage]]
88
== And Query Usage
99

10+
A query that matches documents using the `AND` boolean operator on other queries.
11+
12+
WARNING: Deprecated in 2.0.0-beta1. Use the <<bool-queries, bool query>> instead.
13+
14+
See the Elasticsearch documentation on {ref_current}/query-dsl-and-query.html[and query] for more details.
15+
1016
=== Fluent DSL Example
1117

1218
[source,csharp]

Diff for: docs/asciidoc/query-dsl/compound/filtered/filtered-query-usage.asciidoc

+63-56
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,63 @@
1-
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/2.3
2-
3-
:github: https://github.com/elastic/elasticsearch-net
4-
5-
:nuget: https://www.nuget.org/packages
6-
7-
[[filtered-query-usage]]
8-
== Filtered Query Usage
9-
10-
=== Fluent DSL Example
11-
12-
[source,csharp]
13-
----
14-
q
15-
.Filtered(c => c
16-
.Name("named_query")
17-
.Boost(1.1)
18-
.Filter(qq => qq.MatchAll(m => m.Name("filter")))
19-
.Query(qq => qq.MatchAll(m => m.Name("query")))
20-
)
21-
----
22-
23-
=== Object Initializer Syntax Example
24-
25-
[source,csharp]
26-
----
27-
new FilteredQuery()
28-
{
29-
Name = "named_query",
30-
Boost = 1.1,
31-
Filter = new MatchAllQuery { Name ="filter" },
32-
Query = new MatchAllQuery() { Name = "query" },
33-
}
34-
----
35-
36-
[source,javascript]
37-
.Example json output
38-
----
39-
{
40-
"filtered": {
41-
"_name": "named_query",
42-
"boost": 1.1,
43-
"filter": {
44-
"match_all": {
45-
"_name": "filter"
46-
}
47-
},
48-
"query": {
49-
"match_all": {
50-
"_name": "query"
51-
}
52-
}
53-
}
54-
}
55-
----
56-
1+
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/2.3
2+
3+
:github: https://github.com/elastic/elasticsearch-net
4+
5+
:nuget: https://www.nuget.org/packages
6+
7+
[[filtered-query-usage]]
8+
== Filtered Query Usage
9+
10+
The filtered query is used to combine a query which will be used for scoring with another
11+
query which will only be used for filtering the result set.
12+
13+
WARNING: Deprecated in 2.0.0-beta1. Use the <<bool-queries, bool query>> instead with a`must` clause for the query and a `filter` clause for the filter.
14+
15+
See the Elasticsearch documentation on {ref_current}/query-dsl-filtered-query.html[filtered query] for more details.
16+
17+
=== Fluent DSL Example
18+
19+
[source,csharp]
20+
----
21+
q
22+
.Filtered(c => c
23+
.Name("named_query")
24+
.Boost(1.1)
25+
.Filter(qq => qq.MatchAll(m => m.Name("filter")))
26+
.Query(qq => qq.MatchAll(m => m.Name("query")))
27+
)
28+
----
29+
30+
=== Object Initializer Syntax Example
31+
32+
[source,csharp]
33+
----
34+
new FilteredQuery()
35+
{
36+
Name = "named_query",
37+
Boost = 1.1,
38+
Filter = new MatchAllQuery { Name ="filter" },
39+
Query = new MatchAllQuery() { Name = "query" },
40+
}
41+
----
42+
43+
[source,javascript]
44+
.Example json output
45+
----
46+
{
47+
"filtered": {
48+
"_name": "named_query",
49+
"boost": 1.1,
50+
"filter": {
51+
"match_all": {
52+
"_name": "filter"
53+
}
54+
},
55+
"query": {
56+
"match_all": {
57+
"_name": "query"
58+
}
59+
}
60+
}
61+
}
62+
----
63+

Diff for: docs/asciidoc/query-dsl/compound/limit/limit-query-usage.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
[[limit-query-usage]]
88
== Limit Query Usage
99

10+
A `limit` query limits the number of documents (per shard) to execute on.
11+
12+
WARNING: Deprecated in 2.0.0-beta1. Use the `terminate_after` parameter on the request instead.
13+
14+
See the Elasticsearch documentation on {ref_current}/query-dsl-limit-query.html[limit query] for more details.
15+
1016
=== Fluent DSL Example
1117

1218
[source,csharp]

Diff for: docs/asciidoc/query-dsl/compound/not/not-query-usage.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
[[not-query-usage]]
88
== Not Query Usage
99

10+
A query that filters out matched documents using a query.
11+
12+
WARNING: Deprecated in 2.1.0. Use the <<bool-queries, bool query>> with `must_not` clause instead.
13+
14+
See the Elasticsearch documentation on {ref_current}/query-dsl-not-query.html[not query] for more details.
15+
1016
=== Fluent DSL Example
1117

1218
[source,csharp]

Diff for: docs/asciidoc/query-dsl/compound/or/or-query-usage.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
[[or-query-usage]]
88
== Or Query Usage
99

10+
A query that matches documents using the `OR` boolean operator on other queries.
11+
12+
WARNING: Deprecated in 2.0.0-beta1. Use the <<bool-queries, bool query>> instead.
13+
14+
See the Elasticsearch documentation on {ref_current}/query-dsl-or-query.html[or query] for more details.
15+
1016
=== Fluent DSL Example
1117

1218
[source,csharp]

Diff for: src/Nest/Indices/MappingManagement/GetFieldMapping/FieldMappingJsonConverter.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
4141
if (name == "_routing") mapping = po.ToObject<RoutingField>();
4242
if (name == "_index") mapping = po.ToObject<IndexField>();
4343
if (name == "_size") mapping = po.ToObject<SizeField>();
44+
#pragma warning disable 618
4445
if (name == "_timestamp") mapping = po.ToObject<TimestampField>();
4546
if (name == "_ttl") mapping = po.ToObject<TtlField>();
47+
#pragma warning restore 618
4648
if (name == "_parent") mapping = po.ToObject<ParentField>();
4749
//TODO _field_names does not seem to have a special mapping (just returns like _uid) needs CONFIRMATION
4850
}
@@ -58,4 +60,4 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
5860
return r;
5961
}
6062
}
61-
}
63+
}

Diff for: src/Nest/Mapping/MetaFields/Timestamp/TimestampField.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Nest
66
{
77
[JsonConverter(typeof(ReadAsTypeJsonConverter<TimestampField>))]
8+
[Obsolete("use a normal date field and set its value explicitly")]
89
public interface ITimestampField : IFieldMapping
910
{
1011
[JsonProperty("enabled")]
@@ -23,6 +24,7 @@ public interface ITimestampField : IFieldMapping
2324
bool? IgnoreMissing { get; set; }
2425
}
2526

27+
[Obsolete("use a normal date field and set its value explicitly")]
2628
public class TimestampField : ITimestampField
2729
{
2830
public bool Enabled { get; set; }
@@ -32,7 +34,7 @@ public class TimestampField : ITimestampField
3234
public bool? IgnoreMissing { get; set; }
3335
}
3436

35-
37+
[Obsolete("use a normal date field and set its value explicitly")]
3638
public class TimestampFieldDescriptor<T> : DescriptorBase<TimestampFieldDescriptor<T>, ITimestampField>, ITimestampField
3739
{
3840
bool ITimestampField.Enabled { get; set;}

Diff for: src/Tests/Mapping/Metafields/Ttl/TypeMappingTestBase.cs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
using Elasticsearch.Net;
99
using static Nest.Infer;
1010

11+
#pragma warning disable 618
12+
1113
namespace Tests.Mapping.Metafields.Ttl
1214
{
1315
public class TtlMetafieldApiTest : MetafieldsMappingApiTestsBase

0 commit comments

Comments
 (0)