Skip to content

Commit 446c756

Browse files
authored
[DOCS] Add full-text search overview (elastic#119462) (elastic#119607)
1 parent 519086a commit 446c756

File tree

7 files changed

+179
-8
lines changed

7 files changed

+179
-8
lines changed

docs/reference/analysis.asciidoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
--
1010

1111
_Text analysis_ is the process of converting unstructured text, like
12-
the body of an email or a product description, into a structured format that's
13-
optimized for search.
12+
the body of an email or a product description, into a structured format that's <<full-text-search,optimized for search>>.
1413

1514
[discrete]
1615
[[when-to-configure-analysis]]

docs/reference/analysis/tokenizers.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
[[analysis-tokenizers]]
22
== Tokenizer reference
33

4+
.Difference between {es} tokenization and neural tokenization
5+
[NOTE]
6+
====
7+
{es}'s tokenization process produces linguistic tokens, optimized for search and retrieval.
8+
This differs from neural tokenization in the context of machine learning and natural language processing. Neural tokenizers translate strings into smaller, subword tokens, which are encoded into vectors for consumptions by neural networks.
9+
{es} does not have built-in neural tokenizers.
10+
====
11+
412
A _tokenizer_ receives a stream of characters, breaks it up into individual
513
_tokens_ (usually individual words), and outputs a stream of _tokens_. For
614
instance, a <<analysis-whitespace-tokenizer,`whitespace`>> tokenizer breaks
Lines changed: 81 additions & 0 deletions
Loading

docs/reference/intro.asciidoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Refer to <<getting-started,first steps with Elasticsearch>> for a hands-on examp
260260

261261
*{esql}* is a new piped query language and compute engine which was first added in version *8.11*.
262262

263-
{esql} does not yet support all the features of Query DSL, like full-text search and semantic search.
263+
{esql} does not yet support all the features of Query DSL.
264264
Look forward to new {esql} features and functionalities in each release.
265265

266266
Refer to <<search-analyze-query-languages>> for a full overview of the query languages available in {es}.
@@ -280,7 +280,7 @@ The <<search-your-data, `_search` endpoint>> accepts queries written in Query DS
280280

281281
Query DSL support a wide range of search techniques, including the following:
282282

283-
* <<full-text-queries,*Full-text search*>>: Search text that has been analyzed and indexed to support phrase or proximity queries, fuzzy matches, and more.
283+
* <<full-text-search,*Full-text search*>>: Search text that has been analyzed and indexed to support phrase or proximity queries, fuzzy matches, and more.
284284
* <<keyword,*Keyword search*>>: Search for exact matches using `keyword` fields.
285285
* <<semantic-search-semantic-text,*Semantic search*>>: Search `semantic_text` fields using dense or sparse vector search on embeddings generated in your {es} cluster.
286286
* <<knn-search,*Vector search*>>: Search for similar dense vectors using the kNN algorithm for embeddings generated outside of {es}.
@@ -328,8 +328,7 @@ directly executed within {es} itself.
328328

329329
The <<esql-rest,`_query` endpoint>> accepts queries written in {esql} syntax.
330330

331-
Today, it supports a subset of the features available in Query DSL, like aggregations, filters, and transformations.
332-
It does not yet support full-text search or semantic search.
331+
Today, it supports a subset of the features available in Query DSL, but it is rapidly evolving.
333332

334333
It comes with a comprehensive set of <<esql-functions-operators,functions and operators>> for working with data and has robust integration with {kib}'s Discover, dashboards and visualizations.
335334

docs/reference/quickstart/full-text-filtering-tutorial.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<titleabbrev>Basics: Full-text search and filtering</titleabbrev>
55
++++
66

7-
This is a hands-on introduction to the basics of full-text search with {es}, also known as _lexical search_, using the <<search-search,`_search` API>> and <<query-dsl,Query DSL>>.
7+
This is a hands-on introduction to the basics of <<full-text-search,full-text search>> with {es}, also known as _lexical search_, using the <<search-search,`_search` API>> and <<query-dsl,Query DSL>>.
88
You'll also learn how to filter data, to narrow down search results based on exact criteria.
99

1010
In this scenario, we're implementing a search function for a cooking blog.
@@ -632,6 +632,7 @@ This tutorial introduced the basics of full-text search and filtering in {es}.
632632
Building a real-world search experience requires understanding many more advanced concepts and techniques.
633633
Here are some resources once you're ready to dive deeper:
634634

635+
* <<full-text-search, Full-text search>>: Learn about the core components of full-text search in {es}.
635636
* <<search-analyze, Elasticsearch basics — Search and analyze data>>: Understand all your options for searching and analyzing data in {es}.
636637
* <<analysis,Text analysis>>: Understand how text is processed for full-text search.
637638
* <<search-with-elasticsearch>>: Learn about more advanced search techniques using the `_search` API, including semantic search.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[[full-text-search]]
2+
== Full-text search
3+
4+
.Hands-on introduction to full-text search
5+
[TIP]
6+
====
7+
Would you prefer to jump straight into a hands-on tutorial?
8+
Refer to our quick start <<full-text-filter-tutorial,full-text search tutorial>>.
9+
====
10+
11+
Full-text search, also known as lexical search, is a technique for fast, efficient searching through text fields in documents.
12+
Documents and search queries are transformed to enable returning https://www.elastic.co/what-is/search-relevance[relevant] results instead of simply exact term matches.
13+
Fields of type <<text-field-type,`text`>> are analyzed and indexed for full-text search.
14+
15+
Built on decades of information retrieval research, full-text search delivers reliable results that scale predictably as your data grows. Because it runs efficiently on CPUs, {es}'s full-text search requires minimal computational resources compared to GPU-intensive vector operations.
16+
17+
You can combine full-text search with <<semantic-search,semantic search using vectors>> to build modern hybrid search applications. While vector search may require additional GPU resources, the full-text component remains cost-effective by leveraging existing CPU infrastructure.
18+
19+
[discrete]
20+
[[full-text-search-how-it-works]]
21+
=== How full-text search works
22+
23+
The following diagram illustrates the components of full-text search.
24+
25+
image::images/search/full-text-search-overview.svg[Components of full-text search from analysis to relevance scoring, align=center, width=500]
26+
27+
At a high level, full-text search involves the following:
28+
29+
* <<analysis-overview,*Text analysis*>>: Analysis consists of a pipeline of sequential transformations. Text is transformed into a format optimized for searching using techniques such as stemming, lowercasing, and stop word elimination. {es} contains a number of built-in <<analysis-analyzers,analyzers>> and tokenizers, including options to analyze specific language text. You can also create custom analyzers.
30+
+
31+
[TIP]
32+
====
33+
Refer to <<test-analyzer,Test an analyzer>> to learn how to test an analyzer and inspect the tokens and metadata it generates.
34+
====
35+
* *Inverted index creation*: After analysis is complete, {es} builds an inverted index from the resulting tokens.
36+
An inverted index is a data structure that maps each token to the documents that contain it.
37+
It's made up of two key components:
38+
** *Dictionary*: A sorted list of all unique terms in the collection of documents in your index.
39+
** *Posting list*: For each term, a list of document IDs where the term appears, along with optional metadata like term frequency and position.
40+
* *Relevance scoring*: Results are ranked by how relevant they are to the given query. The relevance score of each document is represented by a positive floating-point number called the `_score`. The higher the `_score`, the more relevant the document.
41+
+
42+
The default <<index-modules-similarity,similarity algorithm>> {es} uses for calculating relevance scores is https://en.wikipedia.org/wiki/Okapi_BM25[Okapi BM25], a variation of the https://en.wikipedia.org/wiki/Tf–idf[TF-IDF algorithm]. BM25 calculates relevance scores based on term frequency, document frequency, and document length.
43+
Refer to this https://www.elastic.co/blog/practical-bm25-part-2-the-bm25-algorithm-and-its-variables[technical blog post] for a deep dive into BM25.
44+
* *Full-text search query*: Query text is analyzed <<analysis-index-search-time,the same way as the indexed text>>, and the resulting tokens are used to search the inverted index.
45+
+
46+
Query DSL supports a number of <<full-text-queries,full-text queries>>.
47+
+
48+
As of 8.17, {esql} also supports <<esql-search-functions,full-text search>> functions.
49+
50+
[discrete]
51+
[[full-text-search-getting-started]]
52+
=== Getting started
53+
54+
For a hands-on introduction to full-text search, refer to the <<full-text-filter-tutorial,full-text search tutorial>>.
55+
56+
[discrete]
57+
[[full-text-search-learn-more]]
58+
=== Learn more
59+
60+
Here are some resources to help you learn more about full-text search with {es}.
61+
62+
*Core concepts*
63+
64+
Learn about the core components of full-text search:
65+
66+
* <<text,Text fields>>
67+
* <<analysis,Text analysis>>
68+
** <<analysis-tokenizers,Tokenizers>>
69+
** <<analysis-analyzers,Analyzers>>
70+
71+
*{es} query languages*
72+
73+
Learn how to build full-text search queries using {es}'s query languages:
74+
75+
* <<full-text-queries,Full-text queries using Query DSL>>
76+
* <<esql-search-functions,Full-text search functions in {esql}>>
77+
78+
*Advanced topics*
79+
80+
For a technical deep dive into {es}'s BM25 implementation read this blog post: https://www.elastic.co/blog/practical-bm25-part-2-the-bm25-algorithm-and-its-variables[The BM25 Algorithm and its Variables].
81+
82+
To learn how to optimize the relevance of your search results, refer to <<recipes,Search relevance optimizations>>.

docs/reference/search/search-your-data/search-your-data.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Search for exact values::
1818
Search for <<term-level-queries,exact values or ranges>> of numbers, dates, IPs,
1919
or strings.
2020

21-
Full-text search::
21+
<<full-text-search,Full-text search>>::
2222
Use <<full-text-queries,full text queries>> to query <<analysis,unstructured
2323
textual data>> and find documents that best match query terms.
2424

@@ -43,6 +43,7 @@ DSL, with a simplified user experience. Create search applications based on your
4343
results directly in the Kibana Search UI.
4444

4545
include::search-api.asciidoc[]
46+
include::full-text-search.asciidoc[]
4647
include::../../how-to/recipes.asciidoc[]
4748
// ☝️ search relevance recipes
4849
include::retrievers-overview.asciidoc[]

0 commit comments

Comments
 (0)