@@ -109,3 +109,170 @@ method:
109109----------------------------
110110client.delete(index="test-index", id=1)
111111----------------------------
112+
113+ [discrete]
114+ [[interactive]]
115+ === Interactive examples
116+
117+ The https://github.com/elastic/elasticsearch-labs[elasticsearch-labs]
118+ repo contains interactive and executable
119+ https://github.com/elastic/elasticsearch-labs/tree/main/notebooks[Python
120+ notebooks], sample apps, and resources for testing out Elasticsearch,
121+ using the Python client. These examples are mainly focused on vector
122+ search, hybrid search and generative AI use cases, but you'll also find
123+ examples of basic operations like creating index mappings and performing
124+ lexical search.
125+
126+ ==== Search notebooks
127+
128+ The
129+ https://github.com/elastic/elasticsearch-labs/tree/main/notebooks/search[Search]
130+ folder is a good place to start if you're new to Elasticsearch. This
131+ folder contains a number of notebooks that demonstrate the fundamentals
132+ of Elasticsearch, like indexing vectors, running lexical, semantic and
133+ _hybrid_ searches, and more.
134+
135+ The following notebooks are available:
136+
137+ [arabic, start=0]
138+ * https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/00-quick-start.ipynb[Quick
139+ start]
140+ * https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/01-keyword-querying-filtering.ipynb[Keyword,
141+ querying, filtering]
142+ * https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/02-hybrid-search.ipynb[Hybrid
143+ search]
144+ * https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/03-ELSER.ipynb[Semantic
145+ search with ELSER]
146+ * https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/04-multilingual.ipynb[Multilingual
147+ semantic search]
148+ * https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/05-query-rules.ipynb[Query
149+ rules]
150+ * https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/06-synonyms-api.ipynb[Synonyms
151+ API quick start]
152+
153+ Here's a brief overview of what you'll learn in each notebook.
154+
155+ ===== Quick start
156+
157+ In the
158+ https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/00-quick-start.ipynb[00-quick-start.ipynb]
159+ notebook you'll learn how to:
160+
161+ * Use the Elasticsearch Python client for various operations.
162+ * Create and define an index for a sample dataset with
163+ `dense_vector` fields.
164+ * Transform book titles into embeddings using
165+ https://www.sbert.net[Sentence Transformers] and index them into
166+ Elasticsearch.
167+ * Perform k-nearest neighbors (knn) semantic searches.
168+ * Integrate traditional text-based search with semantic search, for a
169+ hybrid search system.
170+ * Use reciprocal rank fusion (RRF) to intelligently combine search
171+ results from different retrieval systems.
172+
173+ ===== Keyword, querying, filtering
174+
175+ In the
176+ https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/01-keyword-querying-filtering.ipynb[01-keyword-querying-filtering.ipynb]
177+ notebook, you'll learn how to:
178+
179+ * Use
180+ https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html[query
181+ and filter contexts] to search and filter documents in Elasticsearch.
182+ * Execute full-text searches with `match` and `multi-match` queries.
183+ * Query and filter documents based on `text`, `number`, `date`, or
184+ `boolean` values.
185+ * Run multi-field searches using the `multi-match` query.
186+ * Prioritize specific fields in the `multi-match` query for tailored
187+ results.
188+
189+ ===== Hybrid search
190+
191+ In the
192+ https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/02-hybrid-search.ipynb[02-hybrid-search.ipynb]
193+ notebook, you'll learn how to:
194+
195+ * Combine results of traditional text-based search with semantic search,
196+ for a hybrid search system.
197+ * Transform fields in the sample dataset into embeddings using the
198+ Sentence Transformer model and index them into Elasticsearch.
199+ * Use the
200+ https://www.elastic.co/guide/en/elasticsearch/reference/current/rrf.html#rrf-api[RRF
201+ API] to combine the results of a `match` query and a `kNN` semantic
202+ search.
203+ * Walk through a super simple toy example that demonstrates, step by
204+ step, how RRF ranking works.
205+
206+ ===== Semantic search with ELSER
207+
208+ In the
209+ https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/03-ELSER.ipynb[03-ELSER.ipynb]
210+ notebook, you'll learn how to:
211+
212+ * Use the Elastic Learned Sparse Encoder (ELSER) for text
213+ expansion-powered semantic search, out of the box — without training,
214+ fine-tuning, or embeddings generation.
215+ * Download and deploy the ELSER model in your Elastic environment.
216+ * Create an Elasticsearch index named [.title-ref]#search-movies# with
217+ specific mappings and index a dataset of movie descriptions.
218+ * Create an ingest pipeline containing an inference processor for ELSER
219+ model execution.
220+ * Reindex the data from [.title-ref]#search-movies# into another index,
221+ [.title-ref]#elser-movies#, using the ELSER pipeline for text expansion.
222+ * Observe the results of running the documents through the model by
223+ inspecting the additional terms it adds to documents, which enhance
224+ searchability.
225+ * Perform simple keyword searches on the [.title-ref]#elser-movies#
226+ index to assess the impact of ELSER's text expansion.
227+ * Execute ELSER-powered semantic searches using the `text_expansion`
228+ query.
229+
230+ ===== Multilingual semantic search
231+
232+ In the
233+ https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/04-multilingual.ipynb[04-multilingual.ipynb]
234+ notebook, you'll learn how to:
235+
236+ * Use a multilingual embedding model for semantic search across
237+ languages.
238+ * Transform fields in the sample dataset into embeddings using the
239+ Sentence Transformer model and index them into Elasticsearch.
240+ * Use filtering with a `kNN` semantic search.
241+ * Walk through a super simple toy example that demonstrates, step by
242+ step, how multilingual search works across languages, and within
243+ non-English languages.
244+
245+ ===== Query rules
246+
247+ In the
248+ https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/05-query-rules.ipynb[05-query-rules.ipynb]
249+ notebook, you'll learn how to:
250+
251+ * Use the query rules management APIs to create and edit promotional
252+ rules based on contextual queries.
253+ * Apply these query rules by using the `rule_query` in Query DSL.
254+
255+ ===== Synonyms API quick start
256+
257+ In the
258+ https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/search/06-synonyms-api.ipynb[06-synonyms-api.ipynb]
259+ notebook, you'll learn how to:
260+
261+ * Use the synonyms management API to create a synonyms set to enhance
262+ your search recall.
263+ * Configure an index to use search-time synonyms.
264+ * Update synonyms in real time.
265+ * Run queries that are enhanced by synonyms.
266+
267+ ==== Other notebooks
268+
269+ * https://github.com/elastic/elasticsearch-labs/tree/main/notebooks/generative-ai[Generative
270+ AI]. Notebooks that demonstrate various use cases for Elasticsearch as
271+ the retrieval engine and vector store for LLM-powered applications.
272+ * https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/integrations[Integrations].
273+ Notebooks that demonstrate how to integrate popular services and
274+ projects with Elasticsearch, including OpenAI, Hugging Face, and
275+ LlamaIndex
276+ * https://github.com/elastic/elasticsearch-labs/tree/main/notebooks/langchain[Langchain].
277+ Notebooks that demonstrate how to integrate Elastic with LangChain, a
278+ framework for developing applications powered by language models.
0 commit comments