Skip to content

Commit e441ee7

Browse files
committed
Modifies Get started guide, renames and updates Create a new API key page
1 parent 0384cfd commit e441ee7

6 files changed

+110
-170
lines changed
65.1 KB
Loading
44.5 KB
Loading

serverless/index-serverless-elasticsearch.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include::./pages/pricing.asciidoc[leveloffset=+2]
1616

1717
include::./pages/get-started.asciidoc[leveloffset=+2]
1818

19-
include::./pages/create-new-api-key.asciidoc[leveloffset=+2]
19+
include::./pages/connecting-to-es-endpoint.asciidoc[leveloffset=+2]
2020

2121
include::./pages/clients.asciidoc[leveloffset=+2]
2222
include::./pages/clients-go-getting-started.asciidoc[leveloffset=+3]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[[elasticsearch-connecting-to-es-serverless-endpoint]]
2+
= Connecting to your Elasticsearch Serverless endpoint
3+
4+
[discrete]
5+
[[elasticsearch-create-new-api-key]]
6+
== Create a new API key
7+
8+
Create an API key, which will enable you to access the {es} API to ingest and search data.
9+
10+
. On the **Getting Started** page, scroll to **Add an API Key** and select **New**.
11+
+
12+
image::images/create-an-api-key.png[Create an API key.]
13+
. In **Create API Key**, enter a name for your key and (optionally) set an expiration date.
14+
. (Optional) Under **Control Security privileges**, you can set specific access permissions for this API key. By default, it has full access to all APIs.
15+
. (Optional) The **Add metadata** section allows you to add custom key-value pairs to help identify and organize your API keys.
16+
. Select **Create API Key** to finish.
17+
18+
After creation, you'll see your API key displayed as an encoded string.
19+
Store this encoded API key securely. It is displayed only once and cannot be retrieved later.
20+
You will use this encoded API key when sending API requests.
21+
22+
[NOTE]
23+
====
24+
You can't recover or retrieve a lost API key. Instead, you must delete the key and create a new one.
25+
====
26+
27+
[discrete]
28+
[[elasticsearch-get-started-copy-url]]
29+
== Copy your {es} endpoint
30+
31+
Copy the URL of your {es} API endpoint.
32+
You'll send all {es} API requests to this URL.
33+
34+
. On the **Getting Started** page, scroll to **Copy your connection details** section, and find the **Elasticsearch endpoint** field.
35+
. Copy the URL for the Elasticsearch endpoint.
36+
37+
image::images/copy-connection-details.png[Copy your Elasticsearch endpoint.]
38+
39+
[discrete]
40+
[[elasticsearch-get-started-test-connection]]
41+
== Test connection
42+
43+
We'll use the `curl` command to test your connection and make additional API requests.
44+
(See https://everything.curl.dev/install/index.html[Install curl] if you need to install this program.)
45+
46+
`curl` will need access to your Elasticsearch endpoint and `encoded` API key.
47+
Within your terminal, assign these values to the `ES_URL` and `API_KEY` environment variables.
48+
49+
For example:
50+
51+
[source,bash]
52+
----
53+
export ES_URL="https://dda7de7f1d264286a8fc9741c7741690.es.us-east-1.aws.elastic.cloud:443"
54+
export API_KEY="ZFZRbF9Jb0JDMEoxaVhoR2pSa3Q6dExwdmJSaldRTHFXWEp4TFFlR19Hdw=="
55+
----
56+
57+
Then run the following command to test your connection:
58+
59+
[source,bash]
60+
----
61+
curl "${ES_URL}" \
62+
-H "Authorization: ApiKey ${API_KEY}" \
63+
-H "Content-Type: application/json"
64+
----
65+
66+
You should receive a response similar to the following:
67+
68+
[source,json]
69+
----
70+
{
71+
"name" : "serverless",
72+
"cluster_name" : "dda7de7f1d264286a8fc9741c7741690",
73+
"cluster_uuid" : "ws0IbTBUQfigmYAVMztkZQ",
74+
"version" : { ... },
75+
"tagline" : "You Know, for Search"
76+
}
77+
----
78+
79+
Now you're ready to ingest and search some sample documents.

serverless/pages/create-new-api-key.asciidoc

-19
This file was deleted.

serverless/pages/get-started.asciidoc

+30-150
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Once your project is set up, you'll be directed to a page where you can create y
3636
An index is where documents are stored and organized, making it possible to search and retrieve data.
3737

3838
. Enter a name for your index.
39-
. Click *Create my index*. You can also create the index by clicking on *Code* to view and run code examples through the command line.
39+
. Click *Create my index*. You can also create the index by clicking on *Code* to view and run code through the command line.
4040
+
4141
image::images/get-started-create-an-index.png[Create an index.]
4242

@@ -49,170 +49,50 @@ image::images/get-started-create-an-index.png[Create an index.]
4949
You won’t be able to view this API key again. If needed, refer to <<elasticsearch-create-new-api-key,Create a new API key>> to generate a new one.
5050
====
5151

52-
[discrete]
53-
[[elasticsearch-get-started-ingest-data]]
54-
== Ingest data
52+
The UI provides ready-to-use code examples for ingesting data via the REST API.
53+
Choose your preferred tool for making these requests:
5554

56-
The UI provides ready-to-use code examples for ingesting data via the REST API. Choose your preferred tool for making these requests:
5755
* Elastic Console in your project's UI
5856
* Python
5957
* JavaScript
6058
* cURL
61-
If you'd prefer to upload a file using the UI, refer to <<elasticsearch-ingest-data-file-upload>>.
62-
63-
In this section, we walk you through the ingest process using the Console.
64-
65-
. Click *Run in Console*.
66-
. Run the first API call to create the index mapping.
67-
+
68-
[source,console]
69-
----
70-
PUT /search-test/_mapping
71-
{
72-
"properties": {
73-
"vector": {
74-
"type": "dense_vector",
75-
"dims": 3
76-
},
77-
"text": {
78-
"type": "text"
79-
}
80-
}
81-
}
82-
----
83-
84-
. Run the second API call to ingest documents.
85-
86-
[source,console]
87-
----
88-
POST /_bulk?pretty
89-
{ "index": { "_index": "search-test" } }
90-
{"vector":[2.542,5.807,9.735],"text":"Example text 1"}
91-
{ "index": { "_index": "search-test" } }
92-
{"vector":[5.879,8.179,9.932],"text":"Example text 2"}
93-
{ "index": { "_index": "search-test" } }
94-
{"vector":[6.534,7.155,3.236],"text":"Example text 3"}
95-
----
96-
97-
[discrete]
98-
[[elasticsearch-get-started-search-data]]
99-
== Search data
100-
101-
To search, send a `POST` request to the `_search` endpoint, specifying the index to search.
102-
103-
Run the following command to search the `search-test` index for documents containing `Example` in the text field:
104-
105-
[source,bash]
106-
----
107-
POST /search-test/_search?pretty
108-
{
109-
"query": {
110-
"match": {
111-
"text": "Example"
112-
}
113-
}
114-
}
115-
----
116-
117-
This query will use the match query, which is designed to search for full-text fields.
118-
119-
You should receive a response that includes the documents matching your search term.
120-
Here’s an example of what the response might look like:
121-
122-
[source,console]
123-
----
124-
{
125-
"took": 6,
126-
"timed_out": false,
127-
"_shards": {
128-
"total": 3,
129-
"successful": 3,
130-
"skipped": 0,
131-
"failed": 0
132-
},
133-
"hits": {
134-
"total": {
135-
"value": 3,
136-
"relation": "eq"
137-
},
138-
"max_score": 0.2876821,
139-
"hits": [
140-
{
141-
"_index": "search-test",
142-
"_id": "NJZmIJMBSZbIKcD1sOUO",
143-
"_score": 0.2876821,
144-
"_source": {
145-
"vector": [
146-
2.352,
147-
4.133,
148-
1.718
149-
],
150-
"text": "Example text 2"
151-
}
152-
},
153-
{
154-
"_index": "search-test",
155-
"_id": "M5ZmIJMBSZbIKcD1sOUO",
156-
"_score": 0.18232156,
157-
"_source": {
158-
"vector": [
159-
6.407,
160-
1.821,
161-
0.404
162-
],
163-
"text": "Example text 1"
164-
}
165-
},
166-
{
167-
"_index": "search-test",
168-
"_id": "NZZmIJMBSZbIKcD1sOUO",
169-
"_score": 0.18232156,
170-
"_source": {
171-
"vector": [
172-
4.959,
173-
5.986,
174-
3.873
175-
],
176-
"text": "Example text 3"
177-
}
178-
}
179-
]
180-
}
181-
}
182-
----
183-
184-
In this response:
185-
186-
- `hits`: This section contains the matching documents. Each document includes the `_source` field with the original vector and text fields.
187-
- `_score`: This field indicates the relevance score of each document to the search query. A higher score means a closer match.
18859

18960
[discrete]
19061
[[elasticsearch-get-started-continue-on-your-own]]
191-
== Continue on your own
192-
193-
Congratulations!
194-
You've set up an {es} project, and you've ingested and searched some sample data.
195-
Now you're ready to continue on your own.
196-
197-
[discrete]
198-
[[elasticsearch-get-started-explore]]
199-
=== Explore
200-
201-
Want to explore the sample documents or your own data?
202-
203-
By creating a data view, you can explore data using several UI tools, such as Discover or Dashboards. Or, use {es} aggregations to explore your data using the API. Find more information in <<elasticsearch-explore-your-data>>.
62+
== Ingest data
20463

205-
[discrete]
206-
[[elasticsearch-get-started-build]]
207-
=== Build
64+
Elasticsearch provides several methods for ingesting data:
20865

209-
Ready to build your own solution?
66+
* <<elasticsearch-ingest-data-through-api,{es} API>>
67+
* <<elasticsearch-ingest-data-through-integrations-connector-client,Connector clients>>
68+
* <<elasticsearch-ingest-data-file-upload,File Uploader>>
69+
* <<elasticsearch-ingest-data-through-beats,{beats}>>
70+
* <<elasticsearch-ingest-data-through-logstash,{ls}>>
71+
* https://github.com/elastic/crawler[Elastic Open Web Crawler]
21072

211-
To learn more about sending and syncing data to {es}, or the search API and its query DSL, check <<elasticsearch-ingest-your-data>> and <<elasticsearch-http-apis>>.
73+
For more information on data ingestion and synchronization,
74+
see <<elasticsearch-ingest-your-data>>.
75+
To learn about the search API and query DSL, refer to <<elasticsearch-http-apis>>.
21276

21377
////
21478
/*
21579
- <DocLink slug="/serverless/elasticsearch/search-your-data" />
21680
- <DocLink slug="/serverless/elasticsearch/search-your-data-the-search-api" />
21781
*/
21882
////
83+
84+
[discrete]
85+
[[elasticsearch-get-started-explore]]
86+
== Explore
87+
88+
*Create a data view*: You can explore data using UI tools like Discover or Dashboards by creating a data view.
89+
Or, you can use {es} aggregations to explore data through the API. Find more information in <<elasticsearch-explore-your-data>>.
90+
91+
*Try Playground*: You can test {es} queries and combine {es} data with LLMs for retrieval augmented generation (RAG) in the
92+
<<elasticsearch-playground>>.
93+
94+
*Search your data*: You can perform search queries in {es} to filter by exact values,
95+
conduct full-text searches, or use vector search. Learn more in <<elasticsearch-search-your-data>>.
96+
97+
*Use semantic search*: You can retrieve data based on intent and context using NLP and vector embeddings with
98+
<<elasticsearch-reference-semantic-search>>.

0 commit comments

Comments
 (0)