Skip to content

Commit 8fe28a9

Browse files
committed
update stale docs
1 parent 6ac1cb1 commit 8fe28a9

File tree

2 files changed

+97
-1
lines changed

2 files changed

+97
-1
lines changed

docs/aggregations/bucket/geo-hash-grid/geo-hash-grid-aggregation-usage.asciidoc

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,63 @@ var myGeoHashGrid = response.Aggregations.GeoHash("my_geohash_grid");
6565
myGeoHashGrid.Should().NotBeNull();
6666
----
6767

68+
==== Fluent DSL example
69+
70+
[source,csharp]
71+
----
72+
a => a
73+
.GeoHash("my_geohash_grid", g => g
74+
.Field(p => p.LocationPoint)
75+
.Bounds(b => b
76+
.TopLeft(90,-180)
77+
.BottomRight(-90, 180)
78+
)
79+
)
80+
----
81+
82+
==== Object Initializer syntax example
83+
84+
[source,csharp]
85+
----
86+
new GeoHashGridAggregation("my_geohash_grid")
87+
{
88+
Field = Field<Project>(p => p.LocationPoint),
89+
Bounds = new BoundingBox
90+
{
91+
TopLeft = new GeoLocation(90, -180),
92+
BottomRight = new GeoLocation(-90, 180)
93+
}
94+
}
95+
----
96+
97+
[source,javascript]
98+
.Example json output
99+
----
100+
{
101+
"my_geohash_grid": {
102+
"geohash_grid": {
103+
"field": "locationPoint",
104+
"bounds": {
105+
"top_left": {
106+
"lat": 90.0,
107+
"lon": -180.0
108+
},
109+
"bottom_right": {
110+
"lat": -90.0,
111+
"lon": 180.0
112+
}
113+
}
114+
}
115+
}
116+
}
117+
----
118+
119+
==== Handling Responses
120+
121+
[source,csharp]
122+
----
123+
response.ShouldBeValid();
124+
var myGeoHashGrid = response.Aggregations.GeoHash("my_geohash_grid");
125+
myGeoHashGrid.Should().NotBeNull();
126+
----
127+

docs/query-dsl/specialized/rank-feature/rank-feature-query-usage.asciidoc

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ q
4444
new RankFeatureQuery()
4545
{
4646
Name = "named_query",
47-
Boost = 1.1,
47+
Boost = 1.1,
4848
Field = Infer.Field<Project>(f => f.Rank),
4949
Function = new RankFeatureSaturationFunction()
5050
}
@@ -63,3 +63,39 @@ new RankFeatureQuery()
6363
}
6464
----
6565

66+
==== Fluent DSL example
67+
68+
[source,csharp]
69+
----
70+
q
71+
.RankFeature(rf => rf
72+
.Name("named_query")
73+
.Boost(1.1)
74+
.Field(f => f.Rank)
75+
)
76+
----
77+
78+
==== Object Initializer syntax example
79+
80+
[source,csharp]
81+
----
82+
new RankFeatureQuery
83+
{
84+
Name = "named_query",
85+
Boost = 1.1,
86+
Field = Infer.Field<Project>(f => f.Rank),
87+
}
88+
----
89+
90+
[source,javascript]
91+
.Example json output
92+
----
93+
{
94+
"rank_feature": {
95+
"_name": "named_query",
96+
"boost": 1.1,
97+
"field": "rank"
98+
}
99+
}
100+
----
101+

0 commit comments

Comments
 (0)