Skip to content

Commit be56367

Browse files
authored
Remove mention of type from Getting Started docs (#5187)
This commit removes the mention of document types from the Getting Started docs.
1 parent 1990762 commit be56367

File tree

4 files changed

+29
-65
lines changed

4 files changed

+29
-65
lines changed

docs/client-concepts/high-level/getting-started.asciidoc

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ var asyncIndexResponse = await client.IndexDocumentAsync(person); <2>
112112
NOTE: All methods available within NEST are exposed as both synchronous and asynchronous versions,
113113
with the latter using the idiomatic *Async suffix on the method name.
114114

115-
This will index the document to the endpoint `/people/person/1`. NEST is smart enough to infer the
116-
type from the Person CLR type as well as infer the id for the document by looking for an `Id` property on the POCO. Take a look
115+
This will index the document to the endpoint `/people/_doc/1`. NEST is smart enough to infer the
116+
the id for the document by looking for an `Id` property on the POCO. Take a look
117117
at <<ids-inference,Ids inference>> to see other ways in which NEST can be configured to infer an id for a document. The default index configured
118118
on `ConnectionSettings` has been used as the index name for the request.
119119

@@ -141,7 +141,7 @@ var searchResponse = client.Search<Person>(s => s
141141
var people = searchResponse.Documents;
142142
----
143143

144-
`people` now holds the first ten people whose first name is Martijn. The search endpoint for this query is
144+
`people` now holds the first ten people whose first name matches Martijn. The search endpoint for this query is
145145
`/people/_search` and the index (`"people"`) has been determined from
146146

147147
. the default index on `ConnectionSettings`
@@ -151,7 +151,7 @@ var people = searchResponse.Documents;
151151
which generates a request to the search endpoint `/people/_search`, using the default index specified on `ConnectionSettings` as the index
152152
in the search request.
153153

154-
Similarly, a search can be performed for `person` types in all indices with `.AllIndices()`
154+
Similarly, a search can be performed in all indices with `.AllIndices()`
155155

156156
[source,csharp]
157157
----
@@ -168,27 +168,9 @@ var searchResponse = client.Search<Person>(s => s
168168
);
169169
----
170170

171-
which generates a request to the search endpoint `/_search`, taking the `person` type from the generic type parameter on the search
172-
method.
171+
which generates a request to the search endpoint `/_search`.
173172

174-
Both `.AllTypes()` and `.AllIndices()` can be provided to perform a search across _all_ types in _all_ indices, generating a request to `/_search`
175-
176-
[source,csharp]
177-
----
178-
var searchResponse = await client.SearchAsync<Person>(s => s
179-
.AllIndices()
180-
.From(0)
181-
.Size(10)
182-
.Query(q => q
183-
.Match(m => m
184-
.Field(f => f.FirstName)
185-
.Query("Martijn")
186-
)
187-
)
188-
);
189-
----
190-
191-
Single or multiple index and type names can be provided in the request;
173+
Single or multiple index names can be provided in the request;
192174
see the documentation on <<indices-paths,Indices paths>> and <<document-paths,Document paths>>, respectively.
193175

194176
All of the search examples so far have used NEST's Fluent API which uses lambda expressions to construct a query with a structure
@@ -227,7 +209,7 @@ Using the low level client via the `.LowLevel` property means you can get with t
227209

228210
. Use the high level client
229211

230-
. Use the low level client where it makes sense, taking advantage of all the strong types within NEST and using the JSON.Net based
212+
. Use the low level client where it makes sense, taking advantage of all the strong types within NEST, and its
231213
serializer for deserialization.
232214

233215
Here's an example
@@ -252,7 +234,7 @@ var responseJson = searchResponse;
252234
----
253235

254236
Here, the query is represented as an anonymous type, but the body of the response is a concrete
255-
implementation of the same response type returned from NEST.
237+
implementation of the same response type returned from the high level client, NEST.
256238

257239
--
258240

docs/client-concepts/high-level/inference/document-paths.asciidoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ please modify the original csharp file found at the link and submit the PR with
1616
=== Document paths
1717

1818
Many APIs in Elasticsearch describe a path to a document. In NEST, besides generating a constructor that takes
19-
and Index, Type and Id separately, we also generate a constructor that allows you to describe the path
19+
an Index and Id separately, we also generate a constructor that allows you to describe the path
2020
to your document more succinctly using a an instance of the `DocumentPath<T>` type.
2121

2222
==== Creating new instances
@@ -30,7 +30,7 @@ Expect("project").WhenSerializing(path.Index);
3030
Expect(1).WhenSerializing(path.Id);
3131
----
3232

33-
You can still override the inferred index and type name
33+
You can still override the inferred index name
3434

3535
[source,csharp]
3636
----
@@ -65,7 +65,7 @@ Expect("project").WhenSerializing(path.Index);
6565
Expect("hello-world").WhenSerializing(path.Id);
6666
----
6767

68-
You can still override the inferred index and type name
68+
You can still override the inferred index name
6969

7070
[source,csharp]
7171
----
@@ -95,7 +95,7 @@ we can see an example of how `DocumentPath` helps your describe your requests mo
9595
[source,csharp]
9696
----
9797
var request = new IndexRequest<Project>(2) { Document = project };
98-
request = new IndexRequest<Project>(project) { };
98+
request = new IndexRequest<Project>(project);
9999
----
100100

101101
when comparing with the full blown constructor and passing document manually,
@@ -110,3 +110,5 @@ request = new IndexRequest<Project>(IndexName.From<Project>(), 2)
110110
};
111111
----
112112

113+
Much more verbose, wouldn't you agree?
114+

tests/Tests/ClientConcepts/HighLevel/GettingStarted.doc.cs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ public async Task Indexing()
118118
* NOTE: All methods available within NEST are exposed as both synchronous and asynchronous versions,
119119
* with the latter using the idiomatic *Async suffix on the method name.
120120
*
121-
* This will index the document to the endpoint `/people/person/1`. NEST is smart enough to infer the
122-
* type from the Person CLR type as well as infer the id for the document by looking for an `Id` property on the POCO. Take a look
121+
* This will index the document to the endpoint `/people/_doc/1`. NEST is smart enough to infer the
122+
* the id for the document by looking for an `Id` property on the POCO. Take a look
123123
* at <<ids-inference,Ids inference>> to see other ways in which NEST can be configured to infer an id for a document. The default index configured
124124
* on `ConnectionSettings` has been used as the index name for the request.
125125
*
@@ -148,17 +148,16 @@ public void Searching()
148148
}
149149

150150
/**
151-
* `people` now holds the first ten people whose first name is Martijn. The search endpoint for this query is
151+
* `people` now holds the first ten people whose first name matches Martijn. The search endpoint for this query is
152152
* `/people/_search` and the index (`"people"`) has been determined from
153153
*
154154
* . the default index on `ConnectionSettings`
155155
* . the `Person` generic type parameter on the search.
156156
*
157-
*
158157
* which generates a request to the search endpoint `/people/_search`, using the default index specified on `ConnectionSettings` as the index
159158
* in the search request.
160159
*
161-
* Similarly, a search can be performed for `person` types in all indices with `.AllIndices()`
160+
* Similarly, a search can be performed in all indices with `.AllIndices()`
162161
*/
163162
public void SearchingAllIndices()
164163
{
@@ -176,28 +175,9 @@ public void SearchingAllIndices()
176175
}
177176

178177
/**
179-
* which generates a request to the search endpoint `/_search`, taking the `person` type from the generic type parameter on the search
180-
* method.
178+
* which generates a request to the search endpoint `/_search`.
181179
*
182-
* Both `.AllTypes()` and `.AllIndices()` can be provided to perform a search across _all_ types in _all_ indices, generating a request to `/_search`
183-
*/
184-
public async Task SearchingAllIndicesAndAllTypes()
185-
{
186-
var searchResponse = await client.SearchAsync<Person>(s => s
187-
.AllIndices()
188-
.From(0)
189-
.Size(10)
190-
.Query(q => q
191-
.Match(m => m
192-
.Field(f => f.FirstName)
193-
.Query("Martijn")
194-
)
195-
)
196-
);
197-
}
198-
199-
/**
200-
* Single or multiple index and type names can be provided in the request;
180+
* Single or multiple index names can be provided in the request;
201181
* see the documentation on <<indices-paths,Indices paths>> and <<document-paths,Document paths>>, respectively.
202182
*
203183
* All of the search examples so far have used NEST's Fluent API which uses lambda expressions to construct a query with a structure
@@ -234,7 +214,7 @@ public async Task ObjectInitializerSyntax()
234214
* Using the low level client via the `.LowLevel` property means you can get with the best of both worlds:
235215
*
236216
* . Use the high level client
237-
* . Use the low level client where it makes sense, taking advantage of all the strong types within NEST and using the JSON.Net based
217+
* . Use the low level client where it makes sense, taking advantage of all the strong types within NEST, and its
238218
* serializer for deserialization.
239219
*
240220
* Here's an example
@@ -260,7 +240,7 @@ public void SearchingWithTheLowLevelClient()
260240
}
261241
/**
262242
* Here, the query is represented as an anonymous type, but the body of the response is a concrete
263-
* implementation of the same response type returned from NEST.
243+
* implementation of the same response type returned from the high level client, NEST.
264244
* --
265245
*/
266246

tests/Tests/ClientConcepts/HighLevel/Inference/DocumentPaths.doc.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class DocumentPaths
1616
* === Document paths
1717
*
1818
* Many APIs in Elasticsearch describe a path to a document. In NEST, besides generating a constructor that takes
19-
* and Index, Type and Id separately, we also generate a constructor that allows you to describe the path
19+
* an Index and Id separately, we also generate a constructor that allows you to describe the path
2020
* to your document more succinctly using a an instance of the `DocumentPath<T>` type.
2121
*/
2222

@@ -29,7 +29,7 @@ [U] public void FromId()
2929
Expect("project").WhenSerializing(path.Index);
3030
Expect(1).WhenSerializing(path.Id);
3131

32-
/** You can still override the inferred index and type name*/
32+
/** You can still override the inferred index name*/
3333
path = new DocumentPath<Project>(1).Index("project1");
3434
Expect("project1").WhenSerializing(path.Index);
3535

@@ -52,7 +52,7 @@ [U] public void FromObject()
5252
Expect("project").WhenSerializing(path.Index);
5353
Expect("hello-world").WhenSerializing(path.Id);
5454

55-
/** You can still override the inferred index and type name*/
55+
/** You can still override the inferred index name*/
5656
path = new DocumentPath<Project>(project).Index("project1");
5757
Expect("project1").WhenSerializing(path.Index);
5858

@@ -72,7 +72,7 @@ [U] public void UsingWithRequests()
7272

7373
/** we can see an example of how `DocumentPath` helps your describe your requests more tersely */
7474
var request = new IndexRequest<Project>(2) { Document = project };
75-
request = new IndexRequest<Project>(project) { };
75+
request = new IndexRequest<Project>(project);
7676

7777
/** when comparing with the full blown constructor and passing document manually,
7878
* `DocumentPath<T>`'s benefits become apparent. Compare the following request that doesn't
@@ -82,9 +82,9 @@ [U] public void UsingWithRequests()
8282
{
8383
Document = project
8484
};
85-
/**
86-
* Much more verbose, wouldn't you agree?
87-
*/
8885
}
86+
/**
87+
* Much more verbose, wouldn't you agree?
88+
*/
8989
}
9090
}

0 commit comments

Comments
 (0)