Skip to content

Commit ab5bd09

Browse files
authored
[Docs] Add Index basics page (#464)
Closes [#369](elastic/docs-projects#369) Preview [here](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/464/manage-data/data-store/index-basics) ### Summary What I changed: - Combined content from the three mapped pages - Altered the heading structure to make sense of the added content and improve readability i.e.: divided the page into **H2: Index components** and **H2: Index management** + changed all other headings to H3 and moved them under the relevant H2 - Drafted a new **Manage component templates** subsection to be consistent with the UI/screenshots - Cut down extra descriptive content from subsections to limit this page to Index _basics_ only, but linked out to relevant pages to compensate. The additions to the Mapping page are from one of the raw migrated files that I think made more sense there than on Index basics - Deleted links to Enriching your data examples from the **Manage enrich policies** subsection because I don't think that's relevant to this page I'll delete the code comments after this is reviewed. @colleenmcginnis @kilfoyle let me know what you think of these decisions. I'm open to all insight/suggestions 😄
1 parent 8453baf commit ab5bd09

File tree

3 files changed

+139
-13
lines changed

3 files changed

+139
-13
lines changed
311 KB
Loading

manage-data/data-store/index-basics.md

Lines changed: 135 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,144 @@ mapped_urls:
77

88
# Index basics
99

10-
% What needs to be done: Refine
10+
This content applies to: [![Elasticsearch](/images/serverless-es-badge.svg "")](/solutions/search.md) [![Observability](/images/serverless-obs-badge.svg "")](/solutions/observability.md) [![Security](/images/serverless-sec-badge.svg "")](/solutions/security/elastic-security-serverless.md)
1111

12-
% GitHub issue: docs-projects#369
12+
An index is a fundamental unit of storage in {{es}}. It is a collection of documents uniquely identified by a name or an [alias](/manage-data/data-store/aliases.md). This unique name is important because it’s used to target the index in search queries and other operations.
1313

14-
% Scope notes: Combine content from linked sources.
14+
::::{tip}
15+
A closely related concept is a [data stream](/manage-data/data-store/index-types/data-streams.md). This index abstraction is optimized for append-only timestamped data, and is made up of hidden, auto-generated backing indices. If you’re working with timestamped data, we recommend the [Elastic Observability](https://www.elastic.co/guide/en/observability/current) solution for additional tools and optimized content.
16+
::::
1517

16-
% Use migrated content from existing pages that map to this page:
18+
## Index components
1719

18-
% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/documents-indices.md
19-
% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/index-mgmt.md
20-
% - [ ] ./raw-migrated-files/docs-content/serverless/index-management.md
20+
An index is made up of the following components.
21+
22+
### Documents [elasticsearch-intro-documents-fields]
23+
24+
{{es}} serializes and stores data in the form of JSON documents. A document is a set of fields, which are key-value pairs that contain your data. Each document has a unique ID, which you can create or have {{es}} auto-generate.
25+
26+
A simple {{es}} document might look like this:
27+
28+
```js
29+
{
30+
"_index": "my-first-elasticsearch-index",
31+
"_id": "DyFpo5EBxE8fzbb95DOa",
32+
"_version": 1,
33+
"_seq_no": 0,
34+
"_primary_term": 1,
35+
"found": true,
36+
"_source": {
37+
"email": "[email protected]",
38+
"first_name": "John",
39+
"last_name": "Smith",
40+
"info": {
41+
"bio": "Eco-warrior and defender of the weak",
42+
"age": 25,
43+
"interests": [
44+
"dolphins",
45+
"whales"
46+
]
47+
},
48+
"join_date": "2024/05/01"
49+
}
50+
}
51+
```
52+
53+
### Metadata fields [elasticsearch-intro-documents-fields-data-metadata]
54+
55+
An indexed document contains data and metadata. [Metadata fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-fields.html) are system fields that store information about the documents. In {{es}}, metadata fields are prefixed with an underscore. For example, the following fields are metadata fields:
56+
57+
* `_index`: The name of the index where the document is stored.
58+
* `_id`: The document’s ID. IDs must be unique per index.
59+
60+
61+
### Mappings and data types [elasticsearch-intro-documents-fields-mappings]
62+
63+
Each index has a [mapping](/manage-data/data-store/mapping.md) or schema for how the fields in your documents are indexed. A mapping defines the [data type](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html) for each field, how the field should be indexed, and how it should be stored.
64+
65+
## Index management
66+
67+
Elastic's index management features are an easy, convenient way to manage your cluster's indices, data streams, index templates, and enrich policies. Practicing good index management ensures your data is stored correctly and in the most cost-effective way possible.
68+
69+
Go to **{{project-settings}} → {{manage-app}} → {{index-manage-app}}**.
70+
71+
### Manage indices
72+
73+
Investigate your indices and perform operations from the **Indices** view.
74+
75+
:::{image} /images/serverless-index-management-indices.png
76+
:alt: Index Management indices
77+
:class: screenshot
78+
:::
79+
80+
* To show details and perform operations, click the index name. To perform operations on multiple indices, select their checkboxes and then open the **Manage** menu. For more information on managing indices, refer to [Index APIs](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices.html).
81+
* To filter the list of indices, use the search bar or click a badge. Badges indicate if an index is a [follower index](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html), a [rollup index](https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-get-rollup-index-caps.html), or [frozen](https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html).
82+
* To drill down into the index [mappings](/manage-data/data-store/mapping.md), [settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings), and statistics, click an index name. From this view, you can navigate to **Discover** to further explore the documents in the index.
83+
* To create new indices, use the **Create index** wizard.
84+
85+
### Manage data streams
86+
87+
A [data stream](/manage-data/data-store/index-types/data-streams.md) lets you store append-only time series data across multiple indices while giving you a single named resource for requests.
88+
89+
Investigate your data streams and address lifecycle management needs in the **Data Streams** view.
90+
91+
:::{image} /images/serverless-management-data-stream.png
92+
:alt: Data stream details
93+
:class: screenshot
94+
:::
95+
96+
In {{es-serverless}}, indices matching the `logs-*-*` pattern use the logsDB index mode by default. The logsDB index mode creates a [logs data stream](https://www.elastic.co/guide/en/elasticsearch/reference/master/logs-data-stream.html).
97+
98+
* To view information about the stream's backing indices, click the number in the **Indices** column.
99+
* A value in the **Data retention** column indicates that the data stream is managed by a data stream lifecycle policy. This value is the time period for which your data is guaranteed to be stored. Data older than this period can be deleted by {{es}} at a later time.
100+
* To modify the data retention value, select an index, open the **Manage** menu, and click **Edit data retention**.
101+
* To view more information about a data stream, such as its generation or its current index lifecycle policy, click the stream's name. From this view, you can navigate to **Discover** to further explore data within the data stream.
102+
103+
### Manage index templates
104+
105+
An [index template](/manage-data/data-store/templates.md) is a way to tell {{es}} how to configure an index when it is created.
106+
107+
Create, edit, clone, and delete your index templates in the **Index Templates** view. Changes made to an index template do not affect existing indices.
108+
109+
:::{image} /images/serverless-index-management-index-templates.png
110+
:alt: Index templates
111+
:class: screenshot
112+
:::
113+
114+
* To show details and perform operations, click the template name.
115+
* To view more information about the component templates within an index template, click the value in the **Component templates** column.
116+
* Values in the **Content** column indicate whether a template contains index mappings, settings, and aliases.
117+
* To create new index templates, use the **Create template** wizard.
118+
119+
### Manage component templates
120+
121+
[Component templates](/manage-data/data-store/templates.md) are reusable building blocks that configure mappings, settings, and aliases.
122+
123+
Create, edit, clone, and delete your component templates in the **Component Templates** view.
124+
125+
:::{image} /images/serverless-management-component-templates.png
126+
:alt: Component templates
127+
:class: screenshot
128+
:::
129+
130+
* To show details and perform operations, click the template name.
131+
* To create new component templates, use the **Create component template** wizard.
132+
133+
### Manage enrich policies
134+
135+
An [enrich policy](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy) is a set of configuration options used to add the right enrich data to the right incoming documents.
136+
137+
Add data from your existing indices to incoming documents using the **Enrich Policies** view.
138+
139+
:::{image} /images/serverless-management-enrich-policies.png
140+
:alt: Enrich policies
141+
:class: screenshot
142+
:::
143+
144+
* To show details click the policy name.
145+
* To perform operations, click the policy name or use the buttons in the **Actions** column.
146+
* To create new policies, use the **Create enrich policy** wizard.
147+
148+
You must execute a new enrich policy before you can use it with an enrich processor. When executed, an enrich policy uses enrich data from the policy's source indices to create a streamlined system index called the enrich index. The policy uses this index to match and enrich incoming documents.
21149

22-
% Internal links rely on the following IDs being on this page (e.g. as a heading ID, paragraph ID, etc):
23150

24-
$$$elasticsearch-intro-documents-fields-mappings$$$

manage-data/data-store/mapping.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ Mapping is the process of defining how a document and the fields it contains are
3434

3535
Each document is a collection of fields, which each have their own [data type](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html). When mapping your data, you create a mapping definition, which contains a list of fields that are pertinent to the document. A mapping definition also includes [metadata fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-fields.html), like the `_source` field, which customize how a document’s associated metadata is handled.
3636

37-
Depending on where you are in your data journey, use **dynamic mapping** and **explicit mapping** to define your data. For example, you can explicitly map fields where you don’t want to use the defaults, or to gain greater control over which fields are created. Then you can allow {{es}} to dynamically map other fields.
37+
Depending on where you are in your data journey, use *dynamic mapping* and *explicit mapping* to define your data. For example, you can explicitly map fields where you don’t want to use the defaults, or to gain greater control over which fields are created. Then you can allow {{es}} to dynamically map other fields. Using a combination of dynamic and explicit mapping on the same index is especially useful when you have a mix of known and unknown fields in your data.
3838

3939
::::{note}
4040
Before 7.0.0, the mapping definition included a type name. {{es}} 7.0.0 and later no longer accept a default mapping. [Removal of mapping types](/manage-data/data-store/mapping/removal-of-mapping-types.md) provides more information.
4141
::::
4242

4343
## Dynamic mapping [mapping-dynamic]
4444

45-
When you use [dynamic mapping](/manage-data/data-store/mapping/dynamic-mapping.md), {{es}} automatically attempts to detect the data type of fields in your documents. This allows you to get started quickly by just adding data to an index. If you index additional documents with new fields, {{es}} will add these fields automatically. You can add fields to the top-level mapping, and to inner [`object`](https://www.elastic.co/guide/en/elasticsearch/reference/current/object.html) and [`nested`](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) fields.
45+
When you use [dynamic mapping](/manage-data/data-store/mapping/dynamic-mapping.md), {{es}} automatically detects the data types of fields in your documents and creates mappings for you. If you index additional documents with new fields, {{es}} will add these fields automatically. You can add fields to the top-level mapping, and to inner [`object`](https://www.elastic.co/guide/en/elasticsearch/reference/current/object.html) and [`nested`](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) fields. Dynamic mapping helps you get started quickly, but might yield suboptimal results for your specific use case due to automatic field type inference.
4646

47-
Use [dynamic templates](/manage-data/data-store/mapping/dynamic-templates.md) to define custom mappings that are applied to dynamically added fields based on the matching condition.
47+
Use [dynamic templates](/manage-data/data-store/mapping/dynamic-templates.md) to define custom mappings that are applied to dynamically added fields based on the matching condition.
4848

4949
## Explicit mapping [mapping-explicit]
5050

51-
Use [explicit mapping](/manage-data/data-store/mapping/explicit-mapping.md) to define exactly how data types are mapped to fields, customized to your specific use case.
51+
Use [explicit mapping](/manage-data/data-store/mapping/explicit-mapping.md) to define mappings by specifying data types for each field. This is recommended for production use cases, because you have full control over how your data is indexed to suit your specific use case.
5252

5353
Defining your own mappings enables you to:
5454

0 commit comments

Comments
 (0)