Skip to content

Commit 4cb20de

Browse files
NickFanerusscam
authored andcommitted
Fixed incorrect and inconsistent variable name in .NET documentation (#4804)
(cherry picked from commit 274edae)
1 parent 5b16055 commit 4cb20de

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

docs/client-concepts/high-level/mapping/parent-child-relationships.asciidoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ to `Routing` which can infer the correct routing key based on the JoinField prop
263263

264264
[source,csharp]
265265
----
266-
var ndexResponse = client.Index(parent, i => i.Routing(Routing.From(parent)));
267-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
266+
var indexResponse = client.Index(parent, i => i.Routing(Routing.From(parent)));
267+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
268268
----
269269

270270
The same goes for when we index a child, we can pass the instance directly to `Routing` and NEST will use the parent id
@@ -273,23 +273,23 @@ create an instance of `Routing`
273273

274274
[source,csharp]
275275
----
276-
ndexResponse = client.Index(child, i => i.Routing(Route(child)));
277-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
276+
indexResponse = client.Index(child, i => i.Routing(Route(child)));
277+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
278278
----
279279

280280
You can always override the default inferred routing though
281281

282282
[source,csharp]
283283
----
284-
ndexResponse = client.Index(child, i => i.Routing("explicit"));
285-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=explicit");
284+
indexResponse = client.Index(child, i => i.Routing("explicit"));
285+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=explicit");
286286
287-
ndexResponse = client.Index(child, i => i.Routing(null));
288-
ndexResponse.ApiCall.Uri.Query.Should().NotContain("routing");
287+
indexResponse = client.Index(child, i => i.Routing(null));
288+
indexResponse.ApiCall.Uri.Query.Should().NotContain("routing");
289289
290290
var indexRequest = new IndexRequest<MyChild>(child) { Routing = Route(child) } ;
291-
ndexResponse = client.Index(indexRequest);
292-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
291+
indexResponse = client.Index(indexRequest);
292+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
293293
----
294294

295295
Its important to note that the routing is resolved at request time, not instantiation time
@@ -298,8 +298,8 @@ here we update the `child`'s `JoinField` after already creating the index reques
298298
[source,csharp]
299299
----
300300
child.MyJoinField = JoinField.Link<MyChild>(parentId: "something-else");
301-
ndexResponse = client.Index(indexRequest);
302-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=something-else");
301+
indexResponse = client.Index(indexRequest);
302+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=something-else");
303303
----
304304

305305
[NOTE]

tests/Tests/ClientConcepts/HighLevel/Mapping/ParentChildRelationships.doc.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -278,34 +278,34 @@ public void Inference()
278278
* here we index `parent` and rather than fishing out the parent id by inspecting `parent` we just pass the instance
279279
* to `Routing` which can infer the correct routing key based on the JoinField property on the instance
280280
*/
281-
var ndexResponse = client.Index(parent, i => i.Routing(Routing.From(parent)));
282-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
281+
var indexResponse = client.Index(parent, i => i.Routing(Routing.From(parent)));
282+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
283283

284284
/**
285285
* The same goes for when we index a child, we can pass the instance directly to `Routing` and NEST will use the parent id
286286
* already specified on `child`. Here we use the static import `using static Nest.Infer` and it's `Route()` static method to
287287
* create an instance of `Routing`
288288
*/
289-
ndexResponse = client.Index(child, i => i.Routing(Route(child)));
290-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
289+
indexResponse = client.Index(child, i => i.Routing(Route(child)));
290+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
291291

292292
/** You can always override the default inferred routing though */
293-
ndexResponse = client.Index(child, i => i.Routing("explicit"));
294-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=explicit");
293+
indexResponse = client.Index(child, i => i.Routing("explicit"));
294+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=explicit");
295295

296-
ndexResponse = client.Index(child, i => i.Routing(null));
297-
ndexResponse.ApiCall.Uri.Query.Should().NotContain("routing");
296+
indexResponse = client.Index(child, i => i.Routing(null));
297+
indexResponse.ApiCall.Uri.Query.Should().NotContain("routing");
298298

299299
var indexRequest = new IndexRequest<MyChild>(child) { Routing = Route(child) } ;
300-
ndexResponse = client.Index(indexRequest);
301-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
300+
indexResponse = client.Index(indexRequest);
301+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");
302302
/**
303303
* Its important to note that the routing is resolved at request time, not instantiation time
304304
* here we update the `child`'s `JoinField` after already creating the index request for `child`
305305
*/
306306
child.MyJoinField = JoinField.Link<MyChild>(parentId: "something-else");
307-
ndexResponse = client.Index(indexRequest);
308-
ndexResponse.ApiCall.Uri.Query.Should().Contain("routing=something-else");
307+
indexResponse = client.Index(indexRequest);
308+
indexResponse.ApiCall.Uri.Query.Should().Contain("routing=something-else");
309309
}
310310
/** [NOTE]
311311
* --

0 commit comments

Comments
 (0)