-
Notifications
You must be signed in to change notification settings - Fork 25.5k
[DOCS][101] Create Elasticsearch basics section, refactor quickstarts section #112436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 34 commits
81aa97c
4682400
dcdcffb
ec87abb
cfbe986
c3984ea
1c57ecd
143b0eb
dadd793
fa818e3
4e815e4
e85565e
3f13270
5251740
1c729db
755e4fd
03500ef
cdef9f5
b758ff8
98a9780
00daf2b
e3fea62
0df8cbe
ddfdf1c
8314217
a2d8d66
ec62068
9629a55
4686858
303109f
754ddaa
d30b432
3a5dca6
216bede
3395671
dfb5916
085625f
c9fa2f0
6da5180
90e5ac0
e96aac0
bcadaa3
09a4120
b1f5144
a4d934c
f655978
a272bf7
0a0a074
a25b908
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,20 @@ | ||
[[getting-started]] | ||
== Quick start guide | ||
== Quick start: Add data using API | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
++++ | ||
<titleabbrev>Basics: Add data using API</titleabbrev> | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
++++ | ||
|
||
This guide helps you learn how to: | ||
In this quickstart guide you'll learn how to: | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
* Run {es} and {kib} (using {ecloud} or in a local Docker dev environment), | ||
* add simple (non-timestamped) dataset to {es}, | ||
* run basic searches. | ||
|
||
[TIP] | ||
==== | ||
If you're interested in using {es} with Python, check out Elastic Search Labs. This is the best place to explore AI-powered search use cases, such as working with embeddings, vector search, and retrieval augmented generation (RAG). | ||
|
||
* https://www.elastic.co/search-labs/tutorials/search-tutorial/welcome[Tutorial]: this walks you through building a complete search solution with {es}, from the ground up. | ||
* https://github.com/elastic/elasticsearch-labs[`elasticsearch-labs` repository]: it contains a range of Python https://github.com/elastic/elasticsearch-labs/tree/main/notebooks[notebooks] and https://github.com/elastic/elasticsearch-labs/tree/main/example-apps[example apps]. | ||
==== | ||
|
||
[discrete] | ||
[[run-elasticsearch]] | ||
=== Run {es} | ||
|
||
The simplest way to set up {es} is to create a managed deployment with {ess} on | ||
{ecloud}. If you prefer to manage your own test environment, install and | ||
run {es} using Docker. | ||
|
||
include::{es-ref-dir}/tab-widgets/code.asciidoc[] | ||
include::{es-ref-dir}/tab-widgets/quick-start-install-widget.asciidoc[] | ||
|
||
[discrete] | ||
[[send-requests-to-elasticsearch]] | ||
=== Send requests to {es} | ||
|
||
You send data and other requests to {es} using REST APIs. This lets you interact | ||
with {es} using any client that sends HTTP requests, such as | ||
https://curl.se[curl]. You can also use {kib}'s Console to send requests to | ||
{es}. | ||
|
||
include::{es-ref-dir}/tab-widgets/api-call-widget.asciidoc[] | ||
* Add a small (non-timestamped) dataset to {es} using the REST API | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
* Run basic searches | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
[discrete] | ||
[[add-data]] | ||
=== Add data | ||
|
||
You add data to {es} as JSON objects called documents. {es} stores these | ||
You add data to {es} as JSON objects called documents. | ||
{es} stores these | ||
documents in searchable indices. | ||
|
||
[discrete] | ||
|
@@ -58,6 +31,13 @@ The request automatically creates the index. | |
PUT books | ||
---- | ||
// TESTSETUP | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
DELETE books | ||
-------------------------------------------------- | ||
// TEARDOWN | ||
|
||
//// | ||
|
||
[source,console] | ||
|
@@ -212,6 +192,42 @@ You should receive a response indicating there were no errors. | |
// TEST[skip:TODO] | ||
=============== | ||
|
||
[discrete] | ||
|
||
[[add-vector-content]] | ||
==== Add vector content | ||
|
||
If you have your own dense vector embeddings, you can index them along with your documents. This example shows how to add a document with an embedding to the `books` index. | ||
|
||
|
||
First, you need to update the mapping to include the `embedding` field. | ||
The `embedding` field must have a `dense_vector` type to enable k-nearest neighbor search. | ||
This example uses a 5-dimensional dense vector for simplicity. | ||
|
||
[source,console] | ||
---- | ||
PUT books/_mapping | ||
{ | ||
"properties": { | ||
"embedding": { "type": "dense_vector", "dims": 5 } | ||
} | ||
} | ||
---- | ||
// TEST[continued] | ||
|
||
Now you can add a document with an embedding to the `books` index. | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
[source,console] | ||
---- | ||
POST books/_doc | ||
{ | ||
"name": "Snow Crash", | ||
"author": "Neal Stephenson", | ||
"release_date": "1992-06-01", | ||
"page_count": 470, | ||
"embedding": [0.1, 0.2, 0.3, 0.4, 0.5] | ||
} | ||
---- | ||
// TEST[continued] | ||
|
||
[discrete] | ||
[[qs-search-data]] | ||
=== Search data | ||
leemthompo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -254,31 +270,23 @@ GET books/_search | |
// TEST[continued] | ||
|
||
[discrete] | ||
[[whats-next]] | ||
=== Next steps | ||
|
||
Now that {es} is up and running and you've learned the basics, you'll probably want to test out larger datasets, or index your own data. | ||
|
||
[discrete] | ||
[[whats-next-search-learn-more]] | ||
==== Learn more about search queries | ||
[[qs-vector-search]] | ||
==== Vector search | ||
|
||
* <<search-with-elasticsearch>>. Jump here to learn about exact value search, full-text search, vector search, and more, using the <<search-search,search API>>. | ||
You can use the <<knn-retriever,`knn` retriever>> to perform a k-nearest neighbor search on the `embedding` field. | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
[discrete] | ||
[[whats-next-more-data]] | ||
==== Add more data | ||
|
||
* Learn how to {kibana-ref}/sample-data.html[install sample data] using {kib}. This is a quick way to test out {es} on larger workloads. | ||
* Learn how to use the {kibana-ref}/connect-to-elasticsearch.html#upload-data-kibana[upload data UI] in {kib} to add your own CSV, TSV, or JSON files. | ||
* Use the https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html[bulk API] to ingest your own datasets to {es}. | ||
|
||
[discrete] | ||
[[whats-next-client-libraries]] | ||
==== {es} programming language clients | ||
|
||
* Check out our https://www.elastic.co/guide/en/elasticsearch/client/index.html[client library] to work with your {es} instance in your preferred programming language. | ||
* If you're using Python, check out https://www.elastic.co/search-labs[Elastic Search Labs] for a range of examples that use the {es} Python client. This is the best place to explore AI-powered search use cases, such as working with embeddings, vector search, and retrieval augmented generation (RAG). | ||
** This extensive, hands-on https://www.elastic.co/search-labs/tutorials/search-tutorial/welcome[tutorial] | ||
walks you through building a complete search solution with {es}, from the ground up. | ||
** https://github.com/elastic/elasticsearch-labs[`elasticsearch-labs`] contains a range of executable Python https://github.com/elastic/elasticsearch-labs/tree/main/notebooks[notebooks] and https://github.com/elastic/elasticsearch-labs/tree/main/example-apps[example apps]. | ||
[source,console] | ||
---- | ||
GET books/_search | ||
{ | ||
"retriever": { | ||
"knn": { | ||
"field": "embedding", | ||
"query_vector": [0.1, 0.3, 0.7, 0.4, 0.5], | ||
"k": 10, | ||
"num_candidates": 10 | ||
} | ||
} | ||
} | ||
---- | ||
// TEST[continued] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
[[quickstart]] | ||
= Quickstart | ||
= API quick starts | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Get started quickly with {es}. | ||
Use these quick starts to get hands-on experience with the {es} APIs. | ||
|
||
* Learn how to run {es} (and {kib}) for <<run-elasticsearch-locally,local development>>. | ||
* Follow our <<getting-started,Quickstart guide>> to add data to {es} and query it. | ||
[discrete] | ||
[[quickstart-requirements]] | ||
== Requirements | ||
|
||
include::run-elasticsearch-locally.asciidoc[] | ||
include::getting-started.asciidoc[] | ||
You'll need a running {es} cluster, together with {kib} to use the Dev Tools API Console. | ||
Get started quickly with a <<run-elasticsearch-locally,local dev environment>> in Docker, or see our <<elasticsearch-intro-deploy,other deployment options>>. | ||
|
||
[discrete] | ||
[[quickstart-list]] | ||
== Hands-on quick starts | ||
|
||
* <<getting-started,Basics: Add data using API>>. Learn how to add data to {es} and perform basic searches. | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
[discrete] | ||
[[quickstart-python-links]] | ||
== Working in Python | ||
leemthompo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
If you're interested in using {es} with Python, check out Elastic Search Labs: | ||
|
||
* https://github.com/elastic/elasticsearch-labs[`elasticsearch-labs` repository]. Contains a range of Python https://github.com/elastic/elasticsearch-labs/tree/main/notebooks[notebooks] and https://github.com/elastic/elasticsearch-labs/tree/main/example-apps[example apps]. | ||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
* https://www.elastic.co/search-labs/tutorials/search-tutorial/welcome[Tutorial]. This walks you through building a complete search solution with {es}, from the ground up using Flask. | ||
|
||
include::getting-started.asciidoc[] |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||
[[run-elasticsearch-locally]] | ||||||
== Run {es} locally in Docker (without security) | ||||||
== Run {es} locally in Docker | ||||||
++++ | ||||||
<titleabbrev>Local dev setup (Docker)</titleabbrev> | ||||||
<titleabbrev>Start in local dev</titleabbrev> | ||||||
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
leemthompo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
++++ | ||||||
|
||||||
[WARNING] | ||||||
|
@@ -12,21 +12,8 @@ The instructions on this page are for *local development only*. Do not use these | |||||
While this approach is convenient for experimenting and learning, you should never run the service in this way in a production environment. | ||||||
|
While this approach is convenient for experimenting and learning, you should never run the service in this way in a production environment. | |
While this approach is convenient for experimenting and learning, you should never run the Elasticsearch in this way in a production environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm one of us edited this to make it grammatically incorrect - "the Elasticsearch"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this order feels off to me:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wanted basics and quick starts to be beside each other rather than have what's new in between as it is today