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