diff --git a/deploy-manage/deploy/self-managed/_snippets/start-local.md b/deploy-manage/deploy/self-managed/_snippets/start-local.md index 461d3d6fa1..9c227c00f9 100644 --- a/deploy-manage/deploy/self-managed/_snippets/start-local.md +++ b/deploy-manage/deploy/self-managed/_snippets/start-local.md @@ -36,4 +36,4 @@ For more detailed information about the `start-local` setup, refer to the [READM ## Next steps [local-dev-next-steps] -Use our [quick start guides](/solutions/search/api-quickstarts.md) to learn the basics of {{es}}. +Use our [quick start guides](/solutions/search/get-started/quickstarts.md) to learn the basics of {{es}}. diff --git a/explore-analyze/query-filter.md b/explore-analyze/query-filter.md index 2473e95dca..8a65723731 100644 --- a/explore-analyze/query-filter.md +++ b/explore-analyze/query-filter.md @@ -27,7 +27,7 @@ You’ll use a combination of an API endpoint and a query language to interact w - A number of [tools](/explore-analyze/query-filter/tools.md) are available for you to save, debug, and optimize your queries. % todo: update link to the best target -If you're just getting started with Elasticsearch, try the hands-on [API quickstart](/solutions/search/elasticsearch-basics-quickstart.md) to learn how to add data and run basic searches using Query DSL and the `_search` endpoint. +If you're just getting started with Elasticsearch, try the hands-on [API quickstart](/get-started/elasticsearch-basics-quickstart.md) to learn how to add data and run basic searches using Query DSL and the `_search` endpoint. ## Filtering diff --git a/explore-analyze/query-filter/languages/esql-getting-started.md b/explore-analyze/query-filter/languages/esql-getting-started.md index 2b944998f1..0bac3c7c82 100644 --- a/explore-analyze/query-filter/languages/esql-getting-started.md +++ b/explore-analyze/query-filter/languages/esql-getting-started.md @@ -424,5 +424,5 @@ To learn more about {{esql}}, refer to [{{esql}} reference](elasticsearch://refe Learn more about using {{esql}} for Search use cases: -- [Search and filter with {{esql}}](/solutions/search/esql-search-tutorial.md): A hands-on tutorial that shows you how to use {{esql}} to search and filter data. +- [Search and filter with {{esql}}](/solutions/search/get-started/esql-search.md): A hands-on tutorial that shows you how to use {{esql}} to search and filter data. - [Using {{esql}} for search](/solutions/search/esql-for-search.md): An overview of your options for using {{esql}} for search use cases. \ No newline at end of file diff --git a/explore-analyze/query-filter/languages/esql-rest.md b/explore-analyze/query-filter/languages/esql-rest.md index ce8c3134d4..83a1d48e58 100644 --- a/explore-analyze/query-filter/languages/esql-rest.md +++ b/explore-analyze/query-filter/languages/esql-rest.md @@ -12,7 +12,7 @@ products: # Use the {{esql}} `_query` API [esql-rest] ::::{tip} -The [Search and filter with {{esql}}](/solutions/search/esql-search-tutorial.md) tutorial provides a hands-on introduction to the {{esql}} query API. +The [Search and filter with {{esql}}](/solutions/search/get-started/esql-search.md) tutorial provides a hands-on introduction to the {{esql}} query API. :::: ## Overview [esql-rest-overview] diff --git a/explore-analyze/query-filter/languages/esql.md b/explore-analyze/query-filter/languages/esql.md index b780519fba..e1cf224032 100644 --- a/explore-analyze/query-filter/languages/esql.md +++ b/explore-analyze/query-filter/languages/esql.md @@ -61,7 +61,7 @@ You can interact with {{esql}} in two ways: - [Use {{esql}} in Elastic Security](/explore-analyze/query-filter/languages/esql-elastic-security.md) - **{{esql}} for search use cases** - [{{esql}} for search landing page](/solutions/search/esql-for-search.md) - - [{{esql}} for search tutorial](/solutions/search/esql-search-tutorial.md) + - [{{esql}} for search tutorial](/solutions/search/get-started/esql-search.md) - **Query multiple sources** - [Query multiple indices](/explore-analyze/query-filter/languages/esql-multi-index.md) - [Query across clusters](/explore-analyze/query-filter/languages/esql-cross-clusters.md) diff --git a/solutions/search/elasticsearch-basics-quickstart.md b/get-started/elasticsearch-basics-quickstart.md similarity index 69% rename from solutions/search/elasticsearch-basics-quickstart.md rename to get-started/elasticsearch-basics-quickstart.md index 862576483a..d24e573bbf 100644 --- a/solutions/search/elasticsearch-basics-quickstart.md +++ b/get-started/elasticsearch-basics-quickstart.md @@ -3,28 +3,36 @@ applies_to: stack: serverless: --- -# Basics quickstart [getting-started] +# Index and search data - -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). You’ll learn how to create an index, add data as documents, work with dynamic and explicit mappings, and perform your first basic searches. +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). +You'll learn how to create an index, add data as documents, work with dynamic and explicit mappings, and perform your first basic searches. ::::{tip} -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. +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. :::: ## Requirements [getting-started-requirements] -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). +You can follow this guide using any {{es}} deployment. +If you do not already have a deployment up and running, 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](/deploy-manage/deploy/self-managed/local-development-installation-quickstart.md). -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): +% TBD: List privileges required to perform these steps -```sh -curl -fsSL https://elastic.co/start-local | sh -``` +## Add data to {{es}} +:::{tip} +This tutorial uses {{es}} APIs, but there are many other ways to [add data to {{es}}](/solutions/search/ingest-for-search.md). +::: -## Step 1: Create an index [getting-started-index-creation] +You add data to {{es}} as JSON objects called documents. +{{es}} stores these documents in searchable indices. + +:::::{stepper} +::::{step} Create an index Create a new index named `books`: @@ -34,7 +42,8 @@ PUT /books The following response indicates the index was created successfully. -::::{dropdown} Example response +:::{dropdown} Example response + ```console-result { "acknowledged": true, @@ -43,30 +52,11 @@ The following response indicates the index was created successfully. } ``` +::: :::: +::::{step} Add a single document - - -## Step 2: Add data to your index [getting-started-add-documents] - -::::{tip} -This tutorial uses {{es}} APIs, but there are many other ways to [add data to {{es}}](ingest-for-search.md). - -:::: - - -You add data to {{es}} as JSON objects called documents. {{es}} stores these documents in searchable indices. - - -### Add a single document [getting-started-add-single-document] - -Submit the following indexing request to add a single document to the `books` index. - -::::{tip} -If the index didn’t already exist, this request would automatically create it. - -:::: - +Submit the following indexing request to add a single document to the `books` index: ```console POST books/_doc @@ -78,9 +68,14 @@ POST books/_doc } ``` +:::{tip} +If the index didn't already exist, this request would automatically create it. +::: + The response includes metadata that {{es}} generates for the document, including a unique `_id` for the document within the index. -::::{dropdown} Example response +:::{dropdown} Example response + ```console-result { "_index": "books", <1> @@ -101,21 +96,19 @@ The response includes metadata that {{es}} generates for the document, including 2. The `_id` field is the unique identifier for the document. 3. The `_version` field indicates the version of the document. 4. The `result` field indicates the result of the indexing operation. -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. +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. 6. The `total` field indicates the total number of shards for the index. 7. The `successful` field indicates the number of shards that the indexing operation was executed on. 8. The `failed` field indicates the number of shards that failed during the indexing operation. *0* indicates no failures. 9. The `_seq_no` field holds a monotonically increasing number incremented for each indexing operation on a shard. 10. The `_primary_term` field is a monotonically increasing number incremented each time a primary shard is assigned to a different node. - +::: :::: +::::{step} Add multiple documents - - -### Add multiple documents [getting-started-add-multiple-documents] - -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). +Use the [`_bulk` endpoint]({{es-apis}}operation/operation-bulk) to add multiple documents in one request. +Bulk data must be formatted as newline-delimited JSON (NDJSON). ```console POST /_bulk @@ -133,7 +126,8 @@ POST /_bulk You should receive a response indicating there were no errors. -::::{dropdown} Example response +:::{dropdown} Example response + ```console-result { "errors": false, @@ -223,20 +217,16 @@ You should receive a response indicating there were no errors. } ``` +::: :::: +::::{step} Use dynamic mappings +[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. +If you use dynamic mapping, {{es}} automatically creates mappings for new fields. +The documents we've added so far have used dynamic mapping, because we didn't specify a mapping when creating the index. -## Step 3: Define mappings and data types [getting-started-mappings-and-data-types] - -[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. - - -### Use dynamic mapping [getting-started-dynamic-mapping] - -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. - -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. +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. ```console POST /books/_doc @@ -251,14 +241,15 @@ POST /books/_doc 1. The new field. - -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. +View the mapping for the `books` index with the [get mapping API]({{es-apis}}operation/operation-indices-get-mapping). +The new field `language` has been added to the mapping with a `text` data type. ```console GET /books/_mapping ``` -::::{dropdown} Example response +:::{dropdown} Example response + ```console-result { "books": { @@ -302,14 +293,11 @@ GET /books/_mapping } } ``` - +::: :::: +::::{step} Add explicit mappings - - -### Define explicit mapping [getting-started-explicit-mapping] - -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). +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). ```console PUT /my-explicit-mappings-books @@ -326,11 +314,10 @@ PUT /my-explicit-mappings-books } ``` -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. +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. 2. The `properties` object defines the fields and their data types for documents in this index. - -::::{dropdown} Example response +:::{dropdown} Example response ```console-result { "acknowledged": true, @@ -339,23 +326,23 @@ PUT /my-explicit-mappings-books } ``` +::: :::: +::::{step} Combine dynamic and explicit mappings +Explicit mappings are defined at index creation, and documents must conform to these mappings. You can also use the [update mapping API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-mapping). When an index has the `dynamic` flag set to `true`, you can add new fields to documents without updating the mapping. +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). -### Combine dynamic and explicit mappings [getting-started-combined-mapping] - -Explicit mappings are defined at index creation, and documents must conform to these mappings. You can also use the [Update mapping API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-mapping). When an index has the `dynamic` flag set to `true`, you can add new fields to documents without updating the mapping. - -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). - - -## Step 4: Search your index [getting-started-search-data] +:::: +::::: -Indexed documents are available for search in near real-time, using the [`_search` API](querying-for-search.md). +## Search your data +Indexed documents are available for search in near real-time, using the [`_search` API](/solutions/search/querying-for-search.md). -### Search all documents [getting-started-search-all-documents] +:::::{stepper} +::::{step} Search all documents Run the following command to search the `books` index for all documents: @@ -363,7 +350,8 @@ Run the following command to search the `books` index for all documents: GET books/_search ``` -::::{dropdown} Example response +:::{dropdown} Example response + ```console-result { "took": 2, <1> @@ -405,18 +393,18 @@ GET books/_search 5. The `total` object provides information about the total number of matching documents 6. The `max_score` field indicates the highest relevance score among all matching documents 7. The `_index` field indicates the index the document belongs to -8. The `_id` field is the document’s unique identifier +8. The `_id` field is the document's unique identifier 9. The `_score` field indicates the relevance score of the document 10. The `_source` field contains the original JSON object submitted during indexing - +::: :::: +::::{step} Try a match query +% Introduce different query languages, in this case Query DSL - -### `match` query [getting-started-match-query] - -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. +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. Run the following command to search the `books` index for documents containing `brave` in the `name` field: @@ -431,7 +419,8 @@ GET books/_search } ``` -::::{dropdown} Example response +:::{dropdown} Example response + ```console-result { "took": 9, @@ -466,15 +455,14 @@ GET books/_search ``` 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. - - +::: :::: +::::: +## Delete your indices (optional) - -## Step 5: Delete your indices (optional) [getting-started-delete-indices] - -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). +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]({{es-apis}}operation/operation-indices-delete). For example, run the following command to delete the indices created in this tutorial: @@ -485,5 +473,6 @@ DELETE /my-explicit-mappings-books ::::{warning} Deleting an index permanently deletes its documents, shards, and metadata. - :::: + +% TBD: What are the recommended next steps? \ No newline at end of file diff --git a/get-started/toc.yml b/get-started/toc.yml index b5cae382dd..f94acfddff 100644 --- a/get-started/toc.yml +++ b/get-started/toc.yml @@ -4,4 +4,5 @@ toc: - file: introduction.md - file: the-stack.md - file: deployment-options.md - - file: versioning-availability.md \ No newline at end of file + - file: versioning-availability.md + - file: elasticsearch-basics-quickstart.md \ No newline at end of file diff --git a/redirects.yml b/redirects.yml index e9d430f1b2..6cc527d348 100644 --- a/redirects.yml +++ b/redirects.yml @@ -7,7 +7,10 @@ redirects: 'reference/observability/fields-and-object-schemas/logs-app-fields.md': '!reference/observability/fields-and-object-schemas.md' 'reference/observability/fields-and-object-schemas/metrics-app-fields.md': '!reference/observability/fields-and-object-schemas.md' 'solutions/observability/infra-and-hosts/universal-profiling-issues.md': 'release-notes/elastic-observability/index.md' - + 'solutions/search/api-quickstarts': 'solutions/search/get-started/quickstarts.md' + 'solutions/search/elasticsearch-basics-quickstart.md': 'get-started/elasticsearch-basics-quickstart.md' + 'solutions/search/querydsl-full-text-filter-tutorial.md': 'solutions/search/get-started/querydsl-filter.md' + '/solutions/search/esql-search-tutorial.md': 'solutions/search/get-started/esql-search.md' # Related to https://github.com/elastic/docs-content/pull/1069 'solutions/observability/apps/llm-observability.md': 'solutions/observability/applications/llm-observability.md' 'solutions/observability/apps.md': 'solutions/observability/applications/index.md' diff --git a/solutions/search/api-quickstarts.md b/solutions/search/api-quickstarts.md deleted file mode 100644 index 92793acec7..0000000000 --- a/solutions/search/api-quickstarts.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -mapped_pages: - - https://www.elastic.co/guide/en/elasticsearch/reference/current/quickstart.html -applies_to: - stack: - serverless: -products: - - id: elasticsearch ---- -# API quickstarts - -:::{tip} -Prefer working in Python? Check out our executable [Python notebooks](https://github.com/elastic/elasticsearch-labs/tree/main/notebooks#readme) in the Elasticsearch Labs repository. -:::: - -Use the following quickstarts to get hands-on experience with Elasticsearch APIs and tools: - -- [Index and search data using Elasticsearch APIs](elasticsearch-basics-quickstart.md): Learn about indices, documents, and mappings, and perform a basic search using the Query DSL. -- [Basic full-text search and filtering in Elasticsearch](querydsl-full-text-filter-tutorial.md): Learn about different options for querying data, including full-text search and filtering, using the Query DSL. -- [Analyze eCommerce data with aggregations using Query DSL](/explore-analyze/query-filter/aggregations/tutorial-analyze-ecommerce-data-with-aggregations-using-query-dsl.md): Learn how to analyze data using different types of aggregations, including metrics, buckets, and pipelines. -% - [Getting started with {{esql}}](esql-getting-started.md): Learn how to query and aggregate your data using {{esql}}. -- [Search and filter with {{esql}}](esql-search-tutorial.md): Learn how to perform full-text and semantic search in {{esql}}, combined with filtering. -- [Semantic search](semantic-search/semantic-search-semantic-text.md): Learn how to create embeddings for your data with `semantic_text` and query using the `semantic` query. - - [Hybrid search](hybrid-semantic-text.md): Learn how to combine semantic search using`semantic_text` with full-text search. -- [Bring your own dense vector embeddings](vector/bring-own-vectors.md): Learn how to ingest dense vector embeddings into Elasticsearch. - -:::{note} -To run the quickstarts, you need a running Elasticsearch cluster. Use [`start-local`](https://github.com/elastic/start-local) to set up a fast local dev environment in Docker, together with Kibana. Run the following command in your terminal: - -```sh -curl -fsSL https://elastic.co/start-local | sh -``` -
-Alternatively, refer to our other [deployment options](/deploy-manage/index.md). -% TODO: UPDATE LINK -::: \ No newline at end of file diff --git a/solutions/search/esql-for-search.md b/solutions/search/esql-for-search.md index 245c5730b3..2bdb0d9687 100644 --- a/solutions/search/esql-for-search.md +++ b/solutions/search/esql-for-search.md @@ -16,7 +16,7 @@ products: This page provides an overview of how to use {{esql}} for search use cases. ::::{tip} -For a hands-on tutorial check out [Search and filter with {{esql}}](esql-search-tutorial.md). +For a hands-on tutorial check out [Search and filter with {{esql}}](/solutions/search/get-started/esql-search.md). :::: ## {{esql}} search quick reference @@ -76,7 +76,7 @@ The following functions provide text-based search capabilities in {{esql}} with - Use the compact [operator syntax (:)](elasticsearch://reference/query-languages/esql/functions-operators/operators.md#esql-match-operator) for simple text matching with default parameters. - Use the [MATCH function syntax](elasticsearch://reference/query-languages/esql/functions-operators/search-functions.md#esql-match) for more control over the query, such as specifying analyzers, fuzziness, and other parameters. -Refer to the [tutorial](esql-search-tutorial.md#step-3-basic-search-operations) for examples of both syntaxes. +Refer to the [tutorial](/solutions/search/get-started/esql-search.md#step-3-basic-search-operations) for examples of both syntaxes. ### `MATCH_PHRASE` function @@ -104,19 +104,19 @@ For migrating queries from other Kibana interfaces, the `KQL` function preserves In {{esql}}, you can perform semantic searches on [`semantic_text`](elasticsearch://reference/elasticsearch/mapping-reference/semantic-text.md) field types using the same match syntax as full-text search. -Refer to [semantic search with semantic_text](/solutions/search/semantic-search/semantic-search-semantic-text.md) for an example or follow the [tutorial](esql-search-tutorial.md#step-5-semantic-search-and-hybrid-search). +Refer to [semantic search with semantic_text](/solutions/search/semantic-search/semantic-search-semantic-text.md) for an example or follow the [tutorial](/solutions/search/get-started/esql-search.md#step-5-semantic-search-and-hybrid-search). ### Hybrid search [Hybrid search](/solutions/search/hybrid-search.md) combines lexical and semantic search with custom weights to leverage both exact keyword matching and semantic understanding. -Refer to [hybrid search with semantic_text](hybrid-semantic-text.md) for an example or follow the [tutorial](esql-search-tutorial.md#step-5-semantic-search-and-hybrid-search). +Refer to [hybrid search with semantic_text](hybrid-semantic-text.md) for an example or follow the [tutorial](/solutions/search/get-started/esql-search.md#step-5-semantic-search-and-hybrid-search). ## Next steps [esql-for-search-next-steps] ### Tutorials and how-to guides [esql-for-search-tutorials] -- [Search and filter with {{esql}}](esql-search-tutorial.md): Hands-on tutorial for getting started with search tools in {{esql}}, with concrete examples of the functionalities described in this page +- [Search and filter with {{esql}}](/solutions/search/get-started/esql-search.md): Hands-on tutorial for getting started with search tools in {{esql}}, with concrete examples of the functionalities described in this page ### Technical reference [esql-for-search-reference] diff --git a/solutions/search/full-text.md b/solutions/search/full-text.md index 72d29ea465..7542546dd5 100644 --- a/solutions/search/full-text.md +++ b/solutions/search/full-text.md @@ -11,7 +11,7 @@ products: # Full-text search [full-text-search] ::::{tip} -Would you prefer to start with a hands-on example? Refer to our [full-text search tutorial](querydsl-full-text-filter-tutorial.md). +Would you prefer to start with a hands-on example? Refer to our [full-text search tutorial](/solutions/search/get-started/querydsl-filter.md). :::: Full-text search, also known as lexical search, is a technique for fast, efficient searching through text fields in documents. Documents and search queries are transformed to enable returning [relevant](https://www.elastic.co/what-is/search-relevance) results instead of simply exact term matches. Fields of type [`text`](elasticsearch://reference/elasticsearch/mapping-reference/text.md#text-field-type) are analyzed and indexed for full-text search. @@ -25,7 +25,7 @@ You can combine full-text search with [semantic search using vectors](semantic-s For a high-level overview of how full-text search works, refer to [How full-text search works](full-text/how-full-text-works.md). -For a hands-on introduction to full-text search, refer to the [full-text search tutorial](querydsl-full-text-filter-tutorial.md). +For a hands-on introduction to full-text search, refer to the [full-text search tutorial](/solutions/search/get-started/querydsl-filter.md). ## Learn more [full-text-search-learn-more] diff --git a/solutions/search/get-started.md b/solutions/search/get-started.md index 61c0c15273..720f5fc464 100644 --- a/solutions/search/get-started.md +++ b/solutions/search/get-started.md @@ -28,5 +28,5 @@ Building a search experience with {{es}} requires a number of fundamental implem Each decision builds on the previous ones, offering flexibility to mix and match approaches based on your needs. ::::{tip} -Already have an {{es}} deployment? You can get started with our hands-on [quick start tutorials](api-quickstarts.md), or check out our [Python notebooks](https://github.com/elastic/elasticsearch-labs/tree/main/notebooks#readme). +Already have an {{es}} deployment? You can get started with our hands-on [quick start tutorials](/solutions/search/get-started/quickstarts.md), or check out our [Python notebooks](https://github.com/elastic/elasticsearch-labs/tree/main/notebooks#readme). :::: \ No newline at end of file diff --git a/solutions/search/esql-search-tutorial.md b/solutions/search/get-started/esql-search.md similarity index 92% rename from solutions/search/esql-search-tutorial.md rename to solutions/search/get-started/esql-search.md index 918507211f..83e44e0b34 100644 --- a/solutions/search/esql-search-tutorial.md +++ b/solutions/search/get-started/esql-search.md @@ -5,10 +5,10 @@ applies_to: navigation_title: Search and filter with ES|QL --- -# Tutorial: Search and filter with {{esql}} +# Search and filter with {{esql}} :::{tip} -This tutorial presents examples in {{esql}} syntax. Refer to [the Query DSL version](querydsl-full-text-filter-tutorial.md) for the equivalent examples in Query DSL syntax. +This quickstart guide presents examples in {{esql}} syntax. Refer to [the Query DSL version](/solutions/search/get-started/querydsl-filter.md) for the equivalent examples in Query DSL syntax. ::: This is a hands-on introduction to the basics of full-text search and semantic search, using [{{esql}}](/explore-analyze/query-filter/languages/esql.md). @@ -21,7 +21,7 @@ In this scenario, we're implementing search for a cooking blog. The blog contain You need a running {{es}} cluster, together with {{kib}} to use the Dev Tools API Console. Refer to [choose your deployment type](/deploy-manage/deploy.md#choosing-your-deployment-type) for deployment options. -Want to get started quickly? Run the following command in your terminal to set up a [single-node local cluster in Docker](get-started.md): +Want to get started quickly? Run the following command in your terminal to set up a [single-node local cluster in Docker](/solutions/search/get-started.md): ```sh curl -fsSL https://elastic.co/start-local | sh @@ -29,7 +29,7 @@ curl -fsSL https://elastic.co/start-local | sh ## Running {{esql}} queries -In this tutorial, {{esql}} examples are displayed in the following format: +In this quickstart guide, {{esql}} examples are displayed in the following format: ```esql FROM cooking_blog @@ -120,16 +120,16 @@ PUT /cooking_blog/_mapping ``` 1. The `standard` analyzer is used by default for `text` fields if an `analyzer` isn't specified. It's included here for demonstration purposes. -2. [Multi-fields](elasticsearch://reference/elasticsearch/mapping-reference/multi-fields.md) are used here to index `text` fields as both `text` and `keyword` [data types](elasticsearch://reference/elasticsearch/mapping-reference/field-data-types.md). This enables both full-text search and exact matching/filtering on the same field. Note that if you used [dynamic mapping](../../manage-data/data-store/mapping/dynamic-field-mapping.md), these multi-fields would be created automatically. +2. [Multi-fields](elasticsearch://reference/elasticsearch/mapping-reference/multi-fields.md) are used here to index `text` fields as both `text` and `keyword` [data types](elasticsearch://reference/elasticsearch/mapping-reference/field-data-types.md). This enables both full-text search and exact matching/filtering on the same field. Note that if you used [dynamic mapping](/manage-data/data-store/mapping/dynamic-field-mapping.md), these multi-fields would be created automatically. 3. The [`ignore_above` parameter](elasticsearch://reference/elasticsearch/mapping-reference/ignore-above.md) prevents indexing values longer than 256 characters in the `keyword` field. Again this is the default value, but it's included here for demonstration purposes. It helps to save disk space and avoid potential issues with Lucene's term byte-length limit. ::::{tip} -Full-text search is powered by [text analysis](full-text/text-analysis-during-search.md). Text analysis normalizes and standardizes text data so it can be efficiently stored in an inverted index and searched in near real-time. Analysis happens at both [index and search time](../../manage-data/data-store/text-analysis/index-search-analysis.md). This tutorial won't cover analysis in detail, but it's important to understand how text is processed to create effective search queries. +Full-text search is powered by [text analysis](/solutions/search/full-text/text-analysis-during-search.md). Text analysis normalizes and standardizes text data so it can be efficiently stored in an inverted index and searched in near real-time. Analysis happens at both [index and search time](/manage-data/data-store/text-analysis/index-search-analysis.md). This quickstart guide won't cover analysis in detail, but it's important to understand how text is processed to create effective search queries. :::: -## Step 2: Add sample blog posts to your index [full-text-filter-tutorial-index-data] +## Step 2: Add sample blog posts to your index -Now you’ll need to index some example blog posts using the [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings). Note that `text` fields are analyzed and multi-fields are generated at index time. +Now you’ll need to index some example blog posts using the [bulk API]({{es-apis}}operation/operation-indices-put-settings). Note that `text` fields are analyzed and multi-fields are generated at index time. ```console POST /cooking_blog/_bulk?refresh=wait_for @@ -311,7 +311,7 @@ FROM cooking_blog ``` :::{tip} -Follow this [tutorial](/solutions/search/semantic-search/semantic-search-semantic-text.md) if you'd like to test out the semantic search workflow against a large dataset. +Follow this [tutorial](/solutions/search/semantic-search/semantic-search-semantic-text.md) if you'd like to test out the semantic search workflow against a large data set. ::: ### Perform hybrid search @@ -470,7 +470,7 @@ FROM cooking_blog METADATA _score This tutorial introduced the basics of search and filtering in {{esql}}. Building a real-world search experience requires understanding many more advanced concepts and techniques. Here are some resources once you're ready to dive deeper: -- [Search with {{esql}}](esql-for-search.md): Learn about all your options for search use cases with {{esql}}. +- [Search with {{esql}}](/solutions/search/esql-for-search.md): Learn about all your options for search use cases with {{esql}}. - [{{esql}} search functions](elasticsearch://reference/query-languages/esql/functions-operators/search-functions.md): Explore the full list of search functions available in {{esql}}. - [Semantic search](/solutions/search/semantic-search.md): Understand your various options for semantic search in Elasticsearch. - [The `semantic_text` workflow](/solutions/search/semantic-search.md#_semantic_text_workflow): Learn how to use the `semantic_text` field type for semantic search. This is the recommended approach for most users looking to perform semantic search in {{es}}, because it abstracts away the complexity of setting up inference endpoints and models. diff --git a/solutions/search/querydsl-full-text-filter-tutorial.md b/solutions/search/get-started/querydsl-filter.md similarity index 87% rename from solutions/search/querydsl-full-text-filter-tutorial.md rename to solutions/search/get-started/querydsl-filter.md index ac9ad9b06c..1066f12e20 100644 --- a/solutions/search/querydsl-full-text-filter-tutorial.md +++ b/solutions/search/get-started/querydsl-filter.md @@ -9,13 +9,13 @@ products: - id: elasticsearch --- -# Tutorial: Full-text search and filtering with Query DSL [full-text-filter-tutorial] +# Full-text search and filtering with Query DSL [full-text-filter-tutorial] :::{tip} -This tutorial presents examples in Query DSL syntax. Refer to [the {{esql}} version](esql-search-tutorial.md) for the equivalent examples in {{esql}} syntax. +This quickstart guide presents examples in Query DSL syntax. Refer to [the {{esql}} version](/solutions/search/get-started/esql-search.md) for the equivalent examples in {{esql}} syntax. ::: -This is a hands-on introduction to the basics of [full-text search](full-text.md) with {{es}}, also known as *lexical search*, using the [`_search` API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search) and [Query DSL](../../explore-analyze/query-filter/languages/querydsl.md). You’ll also learn how to filter data, to narrow down search results based on exact criteria. +This is a hands-on introduction to the basics of [full-text search](/solutions/search/full-text.md) with {{es}}, also known as *lexical search*, using the [`_search` API]({{es-apis}}operation/operation-search) and [Query DSL](/explore-analyze/query-filter/languages/querydsl.md). You’ll also learn how to filter data, to narrow down search results based on exact criteria. In this scenario, we’re implementing a search function for a cooking blog. The blog contains recipes with various attributes including textual content, categorical data, and numerical ratings. @@ -29,18 +29,18 @@ The goal is to create search queries that enable users to: To achieve these goals we’ll use different Elasticsearch queries to perform full-text search, apply filters, and combine multiple search criteria. -## Requirements [full-text-filter-tutorial-requirements] +## Requirements You’ll need a running {{es}} cluster, together with {{kib}} to use the Dev Tools API Console. Refer to [choose your deployment type](/deploy-manage/deploy.md#choosing-your-deployment-type) for deployment options. -Want to get started quickly? Run the following command in your terminal to set up a [single-node local cluster in Docker](get-started.md): +Want to get started quickly? Run the following command in your terminal to set up a [single-node local cluster in Docker](/solutions/search/get-started.md): ```sh curl -fsSL https://elastic.co/start-local | sh ``` -## Step 1: Create an index [full-text-filter-tutorial-create-index] +## Step 1: Create an index Create the `cooking_blog` index to get started: @@ -108,20 +108,20 @@ PUT /cooking_blog/_mapping ``` 1. The `standard` analyzer is used by default for `text` fields if an `analyzer` isn’t specified. It’s included here for demonstration purposes. -2. [Multi-fields](elasticsearch://reference/elasticsearch/mapping-reference/multi-fields.md) are used here to index `text` fields as both `text` and `keyword` [data types](elasticsearch://reference/elasticsearch/mapping-reference/field-data-types.md). This enables both full-text search and exact matching/filtering on the same field. Note that if you used [dynamic mapping](../../manage-data/data-store/mapping/dynamic-field-mapping.md), these multi-fields would be created automatically. +2. [Multi-fields](elasticsearch://reference/elasticsearch/mapping-reference/multi-fields.md) are used here to index `text` fields as both `text` and `keyword` [data types](elasticsearch://reference/elasticsearch/mapping-reference/field-data-types.md). This enables both full-text search and exact matching/filtering on the same field. Note that if you used [dynamic mapping](/manage-data/data-store/mapping/dynamic-field-mapping.md), these multi-fields would be created automatically. 3. The [`ignore_above` parameter](elasticsearch://reference/elasticsearch/mapping-reference/ignore-above.md) prevents indexing values longer than 256 characters in the `keyword` field. Again this is the default value, but it’s included here for demonstration purposes. It helps to save disk space and avoid potential issues with Lucene’s term byte-length limit. ::::{tip} -Full-text search is powered by [text analysis](full-text/text-analysis-during-search.md). Text analysis normalizes and standardizes text data so it can be efficiently stored in an inverted index and searched in near real-time. Analysis happens at both [index and search time](../../manage-data/data-store/text-analysis/index-search-analysis.md). This tutorial won’t cover analysis in detail, but it’s important to understand how text is processed to create effective search queries. +Full-text search is powered by [text analysis](/solutions/search/full-text/text-analysis-during-search.md). Text analysis normalizes and standardizes text data so it can be efficiently stored in an inverted index and searched in near real-time. Analysis happens at both [index and search time](/manage-data/data-store/text-analysis/index-search-analysis.md). This quickstart guide won’t cover analysis in detail, but it’s important to understand how text is processed to create effective search queries. :::: -## Step 2: Add sample blog posts to your index [full-text-filter-tutorial-index-data] +## Step 2: Add sample blog posts to your index -Now you’ll need to index some example blog posts using the [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings). Note that `text` fields are analyzed and multi-fields are generated at index time. +Now you’ll need to index some example blog posts using the [Bulk API]({{es-apis}}operation/operation-indices-put-settings). Note that `text` fields are analyzed and multi-fields are generated at index time. ```console POST /cooking_blog/_bulk?refresh=wait_for @@ -138,9 +138,9 @@ POST /cooking_blog/_bulk?refresh=wait_for ``` -## Step 3: Perform basic full-text searches [full-text-filter-tutorial-match-query] +## Step 3: Perform basic full-text searches -Full-text search involves executing text-based queries across one or more document fields. These queries calculate a relevance score for each matching document, based on how closely the document’s content aligns with the search terms. {{es}} offers various query types, each with its own method for matching text and [relevance scoring](../../explore-analyze/query-filter/languages/querydsl.md#relevance-scores). +Full-text search involves executing text-based queries across one or more document fields. These queries calculate a relevance score for each matching document, based on how closely the document’s content aligns with the search terms. {{es}} offers various query types, each with its own method for matching text and [relevance scoring](/explore-analyze/query-filter/languages/querydsl.md#relevance-scores). ### `match` query [_match_query] @@ -165,7 +165,7 @@ GET /cooking_blog/_search 1. By default, the `match` query uses `OR` logic between the resulting tokens. This means it will match documents that contain either "fluffy" or "pancakes", or both, in the description field. -At search time, {{es}} defaults to the analyzer defined in the field mapping. In this example, we’re using the `standard` analyzer. Using a different analyzer at search time is an [advanced use case](../../manage-data/data-store/text-analysis/index-search-analysis.md#different-analyzers). +At search time, {{es}} defaults to the analyzer defined in the field mapping. In this example, we’re using the `standard` analyzer. Using a different analyzer at search time is an [advanced use case](/manage-data/data-store/text-analysis/index-search-analysis.md#different-analyzers). ::::{dropdown} Example response ```console-result @@ -284,7 +284,7 @@ GET /cooking_blog/_search ``` -## Step 4: Search across multiple fields at once [full-text-filter-tutorial-multi-match] +## Step 4: Search across multiple fields at once When users enter a search query, they often don’t know (or care) whether their search terms appear in a specific field. A [`multi_match`](elasticsearch://reference/query-languages/query-dsl/query-dsl-multi-match-query.md) query allows searching across multiple fields simultaneously. @@ -390,7 +390,7 @@ The `multi_match` query is often recommended over a single `match` query for mos ## Step 5: Filter and find exact matches [full-text-filter-tutorial-filtering] -[Filtering](../../explore-analyze/query-filter/languages/querydsl.md#filter-context) allows you to narrow down your search results based on exact criteria. Unlike full-text searches, filters are binary (yes/no) and do not affect the relevance score. Filters execute faster than queries because excluded results don’t need to be scored. +[Filtering](/explore-analyze/query-filter/languages/querydsl.md#filter-context) allows you to narrow down your search results based on exact criteria. Unlike full-text searches, filters are binary (yes/no) and do not affect the relevance score. Filters execute faster than queries because excluded results don’t need to be scored. This [`bool`](elasticsearch://reference/query-languages/query-dsl/query-dsl-bool-query.md) query will return only blog posts in the "Breakfast" category. @@ -594,7 +594,7 @@ GET /cooking_blog/_search This tutorial introduced the basics of full-text search and filtering in {{es}}. Building a real-world search experience requires understanding many more advanced concepts and techniques. Here are some resources once you’re ready to dive deeper: -* [Full-text search](full-text.md): Learn about the core components of full-text search in {{es}}. -* [Elasticsearch basics — Search and analyze data](../../explore-analyze/query-filter.md): Understand all your options for searching and analyzing data in {{es}}. -* [Text analysis](full-text/text-analysis-during-search.md): Understand how text is processed for full-text search. -* [Search your data](../search.md): Learn about more advanced search techniques using the `_search` API, including semantic search. \ No newline at end of file +* [Full-text search](/solutions/search/full-text.md): Learn about the core components of full-text search in {{es}}. +* [Elasticsearch basics — Search and analyze data](/explore-analyze/query-filter.md): Understand all your options for searching and analyzing data in {{es}}. +* [Text analysis](/solutions/search/full-text/text-analysis-during-search.md): Understand how text is processed for full-text search. +* [Search your data](solutions/search.md): Learn about more advanced search techniques using the `_search` API, including semantic search. \ No newline at end of file diff --git a/solutions/search/get-started/quickstarts.md b/solutions/search/get-started/quickstarts.md index fe86e90a48..33c176fae0 100644 --- a/solutions/search/get-started/quickstarts.md +++ b/solutions/search/get-started/quickstarts.md @@ -1,5 +1,8 @@ --- +mapped_pages: + - https://www.elastic.co/guide/en/elasticsearch/reference/current/quickstart.html applies_to: + stack: ga serverless: ga products: - id: elasticsearch @@ -7,21 +10,28 @@ products: # {{es}} quickstarts -Our quickstarts reduce your time-to-value by offering a fast path to learn about search strategies. -Each quickstart provides: - -- A highly opinionated, fast path to a specific use case -- Sensible configuration defaults with minimal configuration required +Quickstart guides reduce your time-to-value by offering a fast path to learn about search strategies. +Each guide provides a highly opinionated, fast path to a specific use case and sensible configuration defaults with minimal configuration required. Follow the steps in these guides to get started quickly: - [](/solutions/search/get-started/keyword-search-python.md) +- [](/solutions/search/get-started/esql-search.md) +% Learn how to perform full-text and semantic search in {{esql}}, combined with filtering. +- [](/solutions/search/get-started/querydsl-filter.md) +% Learn about different options for querying data, including full-text search and filtering, using the Query DSL. - [](/solutions/search/get-started/semantic-search.md) - [](/solutions/search/vector/bring-own-vectors.md) -For more advanced API examples, check out [](/solutions/search/api-quickstarts.md). - ## Related resources -- [](/get-started/index.md): an introduction to Elastic -- [](/manage-data/ingest.md): an overview of data ingestion methods +For more advanced examples, check out: + +- [](/explore-analyze/query-filter/aggregations/tutorial-analyze-ecommerce-data-with-aggregations-using-query-dsl.md) +% Learn how to analyze data using different types of aggregations, including metrics, buckets, and pipelines. +- [](/solutions/search/hybrid-semantic-text.md) +% Learn how to combine semantic search using`semantic_text` with full-text search. + +:::{tip} +Prefer working in Python? Check out our executable [Python notebooks](https://github.com/elastic/elasticsearch-labs/tree/main/notebooks#readme) in the Elasticsearch Labs repository. +:::: \ No newline at end of file diff --git a/solutions/search/querying-for-search.md b/solutions/search/querying-for-search.md index 7469547aef..eee1c3091b 100644 --- a/solutions/search/querying-for-search.md +++ b/solutions/search/querying-for-search.md @@ -35,5 +35,5 @@ You can use the [{{es}} REST APIs](https://www.elastic.co/docs/api/doc/elasticse ::::{tip} -Try our hands-on [quick start tutorials](api-quickstarts.md) to get started, or check out our [Python notebooks](https://github.com/elastic/elasticsearch-labs/tree/main/notebooks#readme). +Try our hands-on [quick start tutorials](/solutions/search/get-started/quickstarts.md) to get started, or check out our [Python notebooks](https://github.com/elastic/elasticsearch-labs/tree/main/notebooks#readme). :::: diff --git a/solutions/search/serverless-elasticsearch-get-started.md b/solutions/search/serverless-elasticsearch-get-started.md index 56769e58c4..a927d11f20 100644 --- a/solutions/search/serverless-elasticsearch-get-started.md +++ b/solutions/search/serverless-elasticsearch-get-started.md @@ -121,4 +121,4 @@ If you’re already familiar with Elasticsearch, you can jump right into setting ## Next steps [elasticsearch-next-steps] * Once you’ve added data to your {{es-serverless}} project, you can use [Playground](rag/playground.md) to test and tweak {{es}} queries and chat with your data, using GenAI. -* You can also try our hands-on [quick start tutorials](/solutions/search/api-quickstarts.md) in the core {{es}} documentation. +* You can also try our hands-on [quick start tutorials](/solutions/search/get-started/quickstarts.md) in the core {{es}} documentation. diff --git a/solutions/toc.yml b/solutions/toc.yml index 336a5603ec..d1cc0d5e9e 100644 --- a/solutions/toc.yml +++ b/solutions/toc.yml @@ -12,11 +12,8 @@ toc: children: - file: search/get-started/keyword-search-python.md - file: search/get-started/semantic-search.md - - file: search/api-quickstarts.md - children: - - file: search/elasticsearch-basics-quickstart.md - - file: search/querydsl-full-text-filter-tutorial.md - - file: search/esql-search-tutorial.md + - file: search/get-started/esql-search.md + - file: search/get-started/querydsl-filter.md - file: search/ingest-for-search.md children: - file: search/search-pipelines.md