Skip to content

Commit ebe499b

Browse files
Merge branch 'main' into rip-serverless-files-pt1
2 parents 4c46875 + 0491a1f commit ebe499b

File tree

142 files changed

+6448
-12424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+6448
-12424
lines changed

deploy-manage/deploy/cloud-on-k8s/configure-eck.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mapped_pages:
1111
This page explains the various methods for configuring and applying ECK settings.
1212

1313
::::{tip}
14-
For a detailed list and description of all available settings in ECK, refer to asciidocalypse://reference/cloud/cloud-on-k8s/eck-configuration-flags.md.
14+
For a detailed list and description of all available settings in ECK, refer to [ECK configuration flags](asciidocalypse://docs/cloud-on-k8s/docs/reference/cloud/cloud-on-k8s/eck-configuration-flags.md).
1515
::::
1616

1717
By default, the ECK installation includes a [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) with an `eck.yaml` key where you can add, remove, or update configuration settings. This ConfigMap is mounted into the operator’s container as a file, and provided to the application through the `--config` flag.
@@ -55,7 +55,7 @@ If you installed ECK using the manifests and the commands listed in [Deploy ECK]
5555

5656
You can update the ConfigMap directly using the command `kubectl edit configmap elastic-operator -n elastic-operator` or modify the installation manifests and reapply them with `kubectl apply -f <your-manifest-file.yaml>`.
5757

58-
The following shows the default `elastic-operator` ConfigMap, for reference purposes. Refer to asciidocalypse://reference/cloud/cloud-on-k8s/eck-configuration-flags.md for a complete list of available settings.
58+
The following shows the default `elastic-operator` ConfigMap, for reference purposes. Refer to [ECK configuration flags](asciidocalypse://docs/cloud-on-k8s/docs/reference/cloud/cloud-on-k8s/eck-configuration-flags.md) for a complete list of available settings.
5959

6060
```yaml
6161
apiVersion: v1

manage-data/data-store/manage-data-from-the-command-line.md

Lines changed: 128 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,133 @@ mapped_urls:
66

77
# Manage data from the command line
88

9-
% What needs to be done: Lift-and-shift
9+
Learn how to index, update, retrieve, search, and delete documents in an {{es}} cluster from the command line.
1010

11-
% Use migrated content from existing pages that map to this page:
11+
::::{tip}
12+
If you are looking for a user interface for {{es}} and your data, head on over to [Kibana](/get-started/the-stack.md)! Not only are there amazing visualization and index management tools, Kibana includes realistic sample data sets to play with so that you can get to know what you *could* do with your data.
13+
::::
14+
15+
## Before you begin [before-you-begin]
16+
17+
On the **Overview** page for your new cluster in the Cloud UI, copy the {{es}} endpoint URL under **Endpoints**.
18+
19+
These examples use the `elastic` user. If you didn’t copy down the password for the `elastic` user, you can [reset the password](/deploy-manage/users-roles/cluster-or-deployment-auth/built-in-users.md).
20+
21+
To use these examples, you also need to have the [curl](http://curl.haxx.se/) command installed.
22+
23+
24+
## Indexing [indexing]
25+
26+
To index a document into {{es}}, `POST` your document:
27+
28+
```bash
29+
curl -u USER:PASSWORD https://ELASTICSEARCH_URL/my_index/_doc -XPOST -H 'Content-Type: application/json' -d '{
30+
"title": "One", "tags": ["ruby"]
31+
}'
32+
```
33+
34+
To show that the operation worked, {{es}} returns a JSON response that looks like `{"_index":"my_index","_type":"_doc","_id":"0KNPhW4BnhCSymaq_3SI","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":0,"_primary_term":1}`.
35+
36+
In this example, the index `my_index` is created dynamically when the first document is inserted into it. All documents in {{es}} have a `type` and an `id`, which is echoed as `"_type":"_doc"` and `_id":"0KNPhW4BnhCSymaq_3SI` in the JSON response. If no ID is specified during indexing, a random `id` is generated.
37+
38+
39+
### Bulk indexing [bulk-indexing]
40+
41+
To achieve the best possible performance, use the bulk API.
42+
43+
To index some additional documents with the bulk API:
44+
45+
```bash
46+
curl -u USER:PASSWORD https://ELASTICSEARCH_URL/my_index/_doc/_bulk -XPOST -H 'Content-Type: application/json' -d '
47+
{"index": {}}
48+
{"title": "Two", "tags": ["ruby", "python"] }
49+
{"index": {}}
50+
{"title": "Three", "tags": ["java"] }
51+
{"index": {}}
52+
{"title": "Four", "tags": ["ruby", "php"] }
53+
'
54+
```
55+
56+
Elasticsearch returns a JSON response similar to this one:
57+
58+
```json
59+
{"took":694,"errors":false,"items":[{"index":{"_index":"my_index","_type":"_doc","_id":"0aNqhW4BnhCSymaqFHQn","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1,"status":201}},{"index":{"_index":"my_index","_type":"_doc","_id":"0qNqhW4BnhCSymaqFHQn","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":1,"_primary_term":1,"status":201}},{"index":{"_index":"my_index","_type":"_doc","_id":"06NqhW4BnhCSymaqFHQn","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":2,"_primary_term":1,"status":201}}]}
60+
```
61+
62+
63+
## Updating [updating]
64+
65+
To update an existing document in {{es}}, `POST` the updated document to `http://ELASTICSEARCH_URL/my_index/_doc/ID`, where the ID is the `_id` of the document.
66+
67+
For example, to update the last document indexed from the previous example with `"_id":"06NqhW4BnhCSymaqFHQn"`:
68+
69+
```bash
70+
curl -u USER:PASSWORD https://ELASTICSEARCH_URL/my_index/_doc/06NqhW4BnhCSymaqFHQn -XPOST -H 'Content-Type: application/json' -d '{
71+
"title": "Four updated", "tags": ["ruby", "php", "python"]
72+
}'
73+
```
74+
75+
The JSON response shows that the version counter for the document got incremented to `_version":2` to reflect the update.
76+
77+
78+
## Retrieving documents [retrieving-documents]
79+
80+
To take a look at a specific document you indexed, here the last document we updated with the ID `0KNPhW4BnhCSymaq_3SI`:
81+
82+
```bash
83+
curl -u USER:PASSWORD https://ELASTICSEARCH_URL/my_index/_doc/06NqhW4BnhCSymaqFHQn
84+
```
85+
86+
This request didn’t include `GET`, as the method is implied if you don’t specify anything else. If the document you are looking for exists, {{es}} returns `found":true` along with the document as part of the JSON response. Otherwise, the JSON response contains `"found":false`.
87+
88+
89+
## Searching [searching]
90+
91+
You issue search requests for documents with one of these {{es}} endpoints:
92+
93+
```bash
94+
https://ELASTICSEARCH_URL/_search
95+
https://ELASTICSEARCH_URL/INDEX_NAME/_search
96+
```
97+
98+
Either a `GET` or a `POST` request with some URI search parameters works, or omit the method to default to `GET` request:
99+
100+
```bash
101+
curl -u USER:PASSWORD https://ELASTICSEARCH_URL/my_index/_doc/_search?q=title:T*
102+
```
103+
104+
For an explanation of the allowed parameters, check [URI Search](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search).
105+
106+
To make {{es}} return a more human readable JSON response, add `?pretty=true` to the request:
107+
108+
```bash
109+
curl -u USER:PASSWORD https://ELASTICSEARCH_URL/my_index/_doc/_search?pretty=true -H 'Content-Type: application/json' -d '{
110+
"query": {
111+
"query_string": {"query": "*"}
112+
}
113+
}'
114+
```
115+
116+
For performance reasons, `?pretty=true` is not recommended in production. You can verify the performance difference yourself by checking the `took` field in the JSON response which tells you how long Elasticsearch took to evaluate the search in milliseconds. When we tested these examples ourselves, the difference was `"took" : 4` against `"took" : 18`, a substantial difference.
117+
118+
For a full explanation of how the request body is structured, check [Elasticsearch Request Body documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html). You can also execute multiple queries in one request with the [Multi Search API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch).
119+
120+
121+
## Deleting [deleting]
122+
123+
You delete documents from {{es}} by sending `DELETE` requests.
124+
125+
To delete a single document by ID from an earlier example:
126+
127+
```bash
128+
curl -u USER:PASSWORD https://ELASTICSEARCH_URL/my_index/_doc/06NqhW4BnhCSymaqFHQn -XDELETE
129+
```
130+
131+
To delete a whole index, here `my_index`:
132+
133+
```bash
134+
curl -u USER:PASSWORD https://ELASTICSEARCH_URL/my_index -XDELETE
135+
```
136+
137+
The JSON response returns `{"acknowledged":true}` to indicate that the index deletion was a success.
12138

13-
% - [ ] ./raw-migrated-files/cloud/cloud/ec-working-with-elasticsearch.md
14-
% - [ ] ./raw-migrated-files/cloud/cloud-enterprise/ece-working-with-elasticsearch.md

manage-data/ingest/transform-enrich/data-enrichment.md

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,85 @@ mapped_urls:
66

77
# Data enrichment
88

9-
% What needs to be done: Lift-and-shift
9+
You can use the [enrich processor](asciidocalypse://docs/elasticsearch/docs/reference/ingestion-tools/enrich-processor/enrich-processor.md) to add data from your existing indices to incoming documents during ingest.
1010

11-
% Use migrated content from existing pages that map to this page:
11+
For example, you can use the enrich processor to:
1212

13-
% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/ingest-enriching-data.md
14-
% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/index-mgmt.md
13+
* Identify web services or vendors based on known IP addresses
14+
* Add product information to retail orders based on product IDs
15+
* Supplement contact information based on an email address
16+
* Add postal codes based on user coordinates
1517

16-
% Internal links rely on the following IDs being on this page (e.g. as a heading ID, paragraph ID, etc):
18+
19+
## How the enrich processor works [how-enrich-works]
20+
21+
Most processors are self-contained and only change *existing* data in incoming documents.
22+
23+
:::{image} ../../../images/elasticsearch-reference-ingest-process.svg
24+
:alt: ingest process
25+
:::
26+
27+
The enrich processor adds *new* data to incoming documents and requires a few special components:
28+
29+
:::{image} ../../../images/elasticsearch-reference-enrich-process.svg
30+
:alt: enrich process
31+
:::
32+
33+
$$$enrich-policy$$$
34+
35+
enrich policy
36+
: A set of configuration options used to add the right enrich data to the right incoming documents.
37+
38+
An enrich policy contains:
39+
40+
* A list of one or more *source indices* which store enrich data as documents
41+
* The *policy type* which determines how the processor matches the enrich data to incoming documents
42+
* A *match field* from the source indices used to match incoming documents
43+
* *Enrich fields* containing enrich data from the source indices you want to add to incoming documents
44+
45+
Before it can be used with an enrich processor, an enrich policy must be [executed](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-execute-policy). 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 processor uses this index to match and enrich incoming documents.
46+
47+
48+
$$$source-index$$$
49+
50+
source index
51+
: An index which stores enrich data you’d like to add to incoming documents. You can create and manage these indices just like a regular {{es}} index. You can use multiple source indices in an enrich policy. You also can use the same source index in multiple enrich policies.
1752

1853
$$$enrich-index$$$
1954

20-
$$$enrich-policy$$$
55+
enrich index
56+
: A special system index tied to a specific enrich policy.
57+
58+
Directly matching incoming documents to documents in source indices could be slow and resource intensive. To speed things up, the enrich processor uses an enrich index.
59+
60+
Enrich indices contain enrich data from source indices but have a few special properties to help streamline them:
61+
62+
* They are system indices, meaning they’re managed internally by {{es}} and only intended for use with enrich processors and the {{esql}} `ENRICH` command.
63+
* They always begin with `.enrich-*`.
64+
* They are read-only, meaning you can’t directly change them.
65+
* They are [force merged](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-forcemerge) for fast retrieval.
66+
67+
## Manage enrich policies [manage-enrich-policies]
68+
69+
Use the **Enrich Policies** view to add data from your existing indices to incoming documents during ingest. An enrich policy contains:
70+
71+
* The policy type that determines how the policy matches the enrich data to incoming documents
72+
* The source indices that store enrich data as documents
73+
* The fields from the source indices used to match incoming documents
74+
* The enrich fields containing enrich data from the source indices that you want to add to incoming documents
75+
* An optional [query](asciidocalypse://docs/elasticsearch/docs/reference/query-languages/query-dsl-match-all-query.md).
76+
77+
:::{image} ../../../images/elasticsearch-reference-management-enrich-policies.png
78+
:alt: Enrich policies
79+
:class: screenshot
80+
:::
81+
82+
When creating an enrich policy, the UI walks you through the configuration setup and selecting the fields. Before you can use the policy with an enrich processor or {{esql}} query, you must execute the policy.
83+
84+
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.
85+
86+
Check out these examples:
87+
88+
* [Example: Enrich your data based on geolocation](/manage-data/ingest/transform-enrich/example-enrich-data-based-on-geolocation.md)
89+
* [Example: Enrich your data based on exact values](/manage-data/ingest/transform-enrich/example-enrich-data-based-on-exact-values.md)
90+
* [Example: Enrich your data by matching a value to a range](/manage-data/ingest/transform-enrich/example-enrich-data-by-matching-value-to-range.md)

raw-migrated-files/cloud/cloud-enterprise/ece-working-with-elasticsearch.md

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)