Skip to content

Commit f324b01

Browse files
ketkee-aryamanebmorelli25szabosteveleemthompo
authored
314 minor fixes for guides (#2371)
Linked to elastic/developer-docs-team#314 and includes fixes for API quickstarts: Minor rephrasing of sentences Shortened sentences Fixes for broken links Also, removed the redundant migrated content after the main header in `explore-analyze/query-filter/languages/querydsl.md` --------- Co-authored-by: Brandon Morelli <[email protected]> Co-authored-by: István Zoltán Szabó <[email protected]> Co-authored-by: Liam Thompson <[email protected]>
1 parent 6abe169 commit f324b01

File tree

4 files changed

+108
-120
lines changed

4 files changed

+108
-120
lines changed

explore-analyze/query-filter/languages/querydsl.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ products:
1111

1212
# Query DSL
1313

14-
$$$filter-context$$$
15-
16-
$$$query-dsl-allow-expensive-queries$$$
17-
18-
$$$relevance-scores$$$
19-
2014
## What's Query DSL? [search-analyze-query-dsl]
2115

2216
**Query DSL** is a full-featured JSON-style query language that enables complex searching, filtering, and aggregations. It is the original and most powerful query language for {{es}} today.
@@ -65,21 +59,21 @@ $$$query-dsl-allow-expensive-queries$$$
6559

6660
**Allow expensive queries**: Certain types of queries will generally execute slowly due to the way they are implemented, which can affect the stability of the cluster. Those queries can be categorized as follows:
6761

68-
- Queries that need to do linear scans to identify matches:
62+
- Queries that need to do linear scans to identify matches:
6963

7064
- [`script` queries](elasticsearch://reference/query-languages/query-dsl/query-dsl-script-query.md)
7165
- queries on [numeric](elasticsearch://reference/elasticsearch/mapping-reference/number.md), [date](elasticsearch://reference/elasticsearch/mapping-reference/date.md), [boolean](elasticsearch://reference/elasticsearch/mapping-reference/boolean.md), [ip](elasticsearch://reference/elasticsearch/mapping-reference/ip.md), [geo_point](elasticsearch://reference/elasticsearch/mapping-reference/geo-point.md) or [keyword](elasticsearch://reference/elasticsearch/mapping-reference/keyword.md) fields that are not indexed but have [doc values](elasticsearch://reference/elasticsearch/mapping-reference/doc-values.md) enabled
7266

73-
- Queries that have a high up-front cost:
67+
- Queries that have a high up-front cost:
7468

7569
- [`fuzzy` queries](elasticsearch://reference/query-languages/query-dsl/query-dsl-fuzzy-query.md) (except on [`wildcard`](elasticsearch://reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields)
7670
- [`regexp` queries](elasticsearch://reference/query-languages/query-dsl/query-dsl-regexp-query.md) (except on [`wildcard`](elasticsearch://reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields)
7771
- [`prefix` queries](elasticsearch://reference/query-languages/query-dsl/query-dsl-prefix-query.md) (except on [`wildcard`](elasticsearch://reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields or those without [`index_prefixes`](elasticsearch://reference/elasticsearch/mapping-reference/index-prefixes.md))
7872
- [`wildcard` queries](elasticsearch://reference/query-languages/query-dsl/query-dsl-wildcard-query.md) (except on [`wildcard`](elasticsearch://reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields)
7973
- [`range` queries](elasticsearch://reference/query-languages/query-dsl/query-dsl-range-query.md) on [`text`](elasticsearch://reference/elasticsearch/mapping-reference/text.md) and [`keyword`](elasticsearch://reference/elasticsearch/mapping-reference/keyword.md) fields
8074

81-
- [Joining queries](elasticsearch://reference/query-languages/query-dsl/joining-queries.md)
82-
- Queries that may have a high per-document cost:
75+
- [Joining queries](elasticsearch://reference/query-languages/query-dsl/joining-queries.md)
76+
- Queries that may have a high per-document cost:
8377

8478
- [`script_score` queries](elasticsearch://reference/query-languages/query-dsl/query-dsl-script-score-query.md)
8579
- [`percolate` queries](elasticsearch://reference/query-languages/query-dsl/query-dsl-percolate-query.md)

solutions/search/elasticsearch-basics-quickstart.md

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ applies_to:
66
# Basics quickstart [getting-started]
77

88

9-
This quick start guide is a hands-on introduction to the fundamental concepts of Elasticsearch: [indices, documents, and field type mappings](../../manage-data/data-store/index-basics.md). Youll learn how to create an index, add data as documents, work with dynamic and explicit mappings, and perform your first basic searches.
9+
This quickstart provides a hands-on introduction to the fundamental concepts of {{es}}: [indices, documents, and field type mappings](../../manage-data/data-store/index-basics.md). You'll learn how to create an index, add documents, work with dynamic and explicit mappings, and perform your first basic searches.
1010

1111
::::{tip}
1212
The code examples in this tutorial are in [Console](../../explore-analyze/query-filter/tools/console.md) syntax by default. You can [convert into other programming languages](../../explore-analyze/query-filter/tools/console.md#import-export-console-requests) in the Console UI.
@@ -15,9 +15,7 @@ The code examples in this tutorial are in [Console](../../explore-analyze/query-
1515

1616
## Requirements [getting-started-requirements]
1717

18-
You can follow this guide using any {{es}} deployment. If you already have a deployment up and running, you can skip ahead to the [first step](#getting-started-index-creation).
19-
20-
If not, refer to [choose your deployment type](/deploy-manage/deploy.md#choosing-your-deployment-type) for your options. To get started quickly, you can spin up a cluster [locally in Docker](get-started.md):
18+
You can follow this guide using any {{es}} deployment. If you have a deployment ready, skip ahead to the [first step](#getting-started-index-creation). If not, refer to [choose your deployment type](/deploy-manage/deploy.md#choosing-your-deployment-type) to see all deployment options. To get started quickly, spin up a cluster [locally in Docker](run-elasticsearch-locally.md):
2119

2220
```sh
2321
curl -fsSL https://elastic.co/start-local | sh
@@ -45,8 +43,6 @@ The following response indicates the index was created successfully.
4543

4644
::::
4745

48-
49-
5046
## Step 2: Add data to your index [getting-started-add-documents]
5147

5248
::::{tip}
@@ -60,10 +56,10 @@ You add data to {{es}} as JSON objects called documents. {{es}} stores these doc
6056

6157
### Add a single document [getting-started-add-single-document]
6258

63-
Submit the following indexing request to add a single document to the `books` index.
59+
Use the following request to add a single document to the `books` index.
6460

65-
::::{tip}
66-
If the index didn’t already exist, this request would automatically create it.
61+
::::{note}
62+
If the index doesn't already exist, this request will automatically create it.
6763

6864
::::
6965

@@ -97,25 +93,23 @@ The response includes metadata that {{es}} generates for the document, including
9793
}
9894
```
9995

100-
1. The `_index` field indicates the index the document was added to.
101-
2. The `_id` field is the unique identifier for the document.
102-
3. The `_version` field indicates the version of the document.
103-
4. The `result` field indicates the result of the indexing operation.
104-
5. The `_shards` field contains information about the number of [shards](../../deploy-manage/index.md) that the indexing operation was executed on and the number that succeeded.
105-
6. The `total` field indicates the total number of shards for the index.
106-
7. The `successful` field indicates the number of shards that the indexing operation was executed on.
107-
8. The `failed` field indicates the number of shards that failed during the indexing operation. *0* indicates no failures.
108-
9. The `_seq_no` field holds a monotonically increasing number incremented for each indexing operation on a shard.
109-
10. The `_primary_term` field is a monotonically increasing number incremented each time a primary shard is assigned to a different node.
96+
1. `_index`: The index the document was added to.
97+
2. `_id`: The unique identifier for the document.
98+
3. `_version`: The version of the document.
99+
4. `result`: The result of the indexing operation.
100+
5. `_shards`: Information about the number of [shards](../../deploy-manage/distributed-architecture/clusters-nodes-shards.md) that the indexing operation was executed on and the number that succeeded.
101+
6. `total`: The total number of shards for the index.
102+
7. `successful`: The number of shards that the indexing operation was performed on.
103+
8. `failed`: The number of shards that failed during the indexing operation. *0* indicates no failures.
104+
9. `_seq_no`: A monotonically increasing number incremented for each indexing operation on a shard.
105+
10. `_primary_term`: A monotonically increasing number incremented each time a primary shard is assigned to a different node.
110106

111107

112108
::::
113109

114-
115-
116110
### Add multiple documents [getting-started-add-multiple-documents]
117111

118-
Use the [`_bulk` endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk) to add multiple documents in one request. Bulk data must be formatted as newline-delimited JSON (NDJSON).
112+
Use the [`_bulk` endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk) to add multiple documents in a single request. Bulk data must be formatted as newline-delimited JSON (NDJSON).
119113

120114
```console
121115
POST /_bulk
@@ -130,7 +124,6 @@ POST /_bulk
130124
{ "index" : { "_index" : "books" } }
131125
{"name": "The Handmaids Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}
132126
```
133-
134127
You should receive a response indicating there were no errors.
135128

136129
::::{dropdown} Example response
@@ -227,16 +220,16 @@ You should receive a response indicating there were no errors.
227220

228221

229222

230-
## Step 3: Define mappings and data types [getting-started-mappings-and-data-types]
223+
## Step 3: Define mappings [getting-started-mappings-and-data-types]
231224

232225
[Mappings](../../manage-data/data-store/index-basics.md#elasticsearch-intro-documents-fields-mappings) define how data is stored and indexed in {{es}}, like a schema in a relational database.
233226

234227

235228
### Use dynamic mapping [getting-started-dynamic-mapping]
236229

237-
When using dynamic mapping, {{es}} automatically creates mappings for new fields by default. The documents we’ve added so far have used dynamic mapping, because we didn’t specify a mapping when creating the index.
230+
When you use dynamic mapping, {{es}} automatically creates mappings for new fields by default. The documents you’ve added so far have used dynamic mapping, because you didn’t specify a mapping while creating the index.
238231

239-
To see how dynamic mapping works, add a new document to the `books` index with a field that doesn’t appear in the existing documents.
232+
To see how dynamic mapping works, add a new document to the `books` index with a field that isn't available in the existing documents.
240233

241234
```console
242235
POST /books/_doc
@@ -251,14 +244,14 @@ POST /books/_doc
251244

252245
1. The new field.
253246

254-
255247
View the mapping for the `books` index with the [Get mapping API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping). The new field `language` has been added to the mapping with a `text` data type.
256248

257249
```console
258250
GET /books/_mapping
259251
```
260-
252+
The following response displays the mappings that were created by {{es}}.
261253
::::{dropdown} Example response
254+
262255
```console-result
263256
{
264257
"books": {
@@ -309,7 +302,7 @@ GET /books/_mapping
309302

310303
### Define explicit mapping [getting-started-explicit-mapping]
311304

312-
Create an index named `my-explicit-mappings-books` with explicit mappings. Pass each field’s properties as a JSON object. This object should contain the [field data type](elasticsearch://reference/elasticsearch/mapping-reference/field-data-types.md) and any additional [mapping parameters](elasticsearch://reference/elasticsearch/mapping-reference/mapping-parameters.md).
305+
Create an index named `my-explicit-mappings-books` and specify the mappings yourself. Pass each field’s properties as a JSON object. This object should contain the [field data type](elasticsearch://reference/elasticsearch/mapping-reference/field-data-types.md) and any additional [mapping parameters](elasticsearch://reference/elasticsearch/mapping-reference/mapping-parameters.md).
313306

314307
```console
315308
PUT /my-explicit-mappings-books
@@ -326,10 +319,10 @@ PUT /my-explicit-mappings-books
326319
}
327320
```
328321

329-
1. Disables dynamic mapping for the index. Fields not defined in the mapping will still be stored in the document's `_source` field, but they won’t be indexed or searchable.
330-
2. The `properties` object defines the fields and their data types for documents in this index.
331-
322+
1. `dynamic`: Disables dynamic mapping for the index. If you don't define fields in the mapping, they'll still be stored in the document's `_source` field, but you can't index or search them.
323+
2. `properties`: Defines the fields and their corresponding data types.
332324

325+
The following response indicates a successful operation.
333326
::::{dropdown} Example response
334327
```console-result
335328
{
@@ -350,14 +343,14 @@ Explicit mappings are defined at index creation, and documents must conform to t
350343
This allows you to combine explicit and dynamic mappings. Learn more about [managing and updating mappings](../../manage-data/data-store/mapping.md#mapping-manage-update).
351344

352345

353-
## Step 4: Search your index [getting-started-search-data]
346+
## Step 4: Search your data [getting-started-search-data]
354347

355348
Indexed documents are available for search in near real-time, using the [`_search` API](querying-for-search.md).
356349

357350

358351
### Search all documents [getting-started-search-all-documents]
359352

360-
Run the following command to search the `books` index for all documents:
353+
Use the following request to search all documents in the `books` index:
361354

362355
```console
363356
GET books/_search
@@ -398,27 +391,25 @@ GET books/_search
398391
}
399392
```
400393

401-
1. The `took` field indicates the time in milliseconds for {{es}} to execute the search
402-
2. The `timed_out` field indicates whether the search timed out
403-
3. The `_shards` field contains information about the number of [shards](/reference/glossary/index.md) that the search was executed on and the number that succeeded
404-
4. The `hits` object contains the search results
405-
5. The `total` object provides information about the total number of matching documents
406-
6. The `max_score` field indicates the highest relevance score among all matching documents
407-
7. The `_index` field indicates the index the document belongs to
408-
8. The `_id` field is the document’s unique identifier
409-
9. The `_score` field indicates the relevance score of the document
410-
10. The `_source` field contains the original JSON object submitted during indexing
394+
1. `took`: The time in milliseconds for {{es}} to execute the search
395+
2. `timed_out`: Indicates if the search timed out
396+
3. `_shards`: Information about the number of [shards](/reference/glossary/index.md) that the search was performed on and the number that succeeded
397+
4. `hits`: Has the search results
398+
5. `total`: Information about the total number of matching documents
399+
6. `max_score`: The highest relevance score among all matching documents
400+
7. `_index`: The index the document belongs to
401+
8. `_id`: The document’s unique identifier
402+
9. `_score`: The relevance score of the document
403+
10. `_source`: The original JSON object submitted during indexing
411404

412405

413406
::::
414407

408+
### Search using `match` query [getting-started-match-query]
415409

410+
Use the [`match` query](elasticsearch://reference/query-languages/query-dsl/query-dsl-match-query.md) to search for documents that contain a specific value in a specific field. This is the standard query for full-text searches.
416411

417-
### `match` query [getting-started-match-query]
418-
419-
You can use the [`match` query](elasticsearch://reference/query-languages/query-dsl/query-dsl-match-query.md) to search for documents that contain a specific value in a specific field. This is the standard query for full-text searches.
420-
421-
Run the following command to search the `books` index for documents containing `brave` in the `name` field:
412+
Use the following request to search the `books` index for documents containing `brave` in the `name` field:
422413

423414
```console
424415
GET books/_search
@@ -465,18 +456,18 @@ GET books/_search
465456
}
466457
```
467458

468-
1. The `max_score` is the score of the highest-scoring document in the results. In this case, there is only one matching document, so the `max_score` is the score of that document.
459+
1. `max_score`: Score of the highest-scoring document in the results. In this case, there is only one matching document, so the `max_score` is the score of that document.
469460

470461

471462
::::
472463

473464

474465

475-
## Step 5: Delete your indices (optional) [getting-started-delete-indices]
466+
## Step 5: Delete your indices [getting-started-delete-indices]
476467

477-
When following along with examples, you might want to delete an index to start from scratch. You can delete indices using the [Delete index API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete).
468+
If you want to delete an index to start from scratch at any point, use the [Delete index API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete).
478469

479-
For example, run the following command to delete the indices created in this tutorial:
470+
For example, use the following request to delete the indices created in this tutorial:
480471

481472
```console
482473
DELETE /books
@@ -487,3 +478,12 @@ DELETE /my-explicit-mappings-books
487478
Deleting an index permanently deletes its documents, shards, and metadata.
488479

489480
::::
481+
482+
## Learn more [full-text-filter-tutorial-learn-more]
483+
484+
This tutorial introduced the basics of creating indices, adding data and performing basic searches with {{es}}. The following resources will help you understand {{es}} concepts better and dive into the basics of query languages for searching data:
485+
486+
* [Fundamentals of Elasticsearch](../../manage-data/data-store.md)
487+
* [Search and filter with Query DSL](querydsl-full-text-filter-tutorial.md)
488+
* [Search using ES|QL](esql-search-tutorial.md)
489+

0 commit comments

Comments
 (0)