Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Vector Search for Practitioners with Elastic

You're reading from  Vector Search for Practitioners with Elastic

Product type Book
Published in Nov 2023
Publisher Packt
ISBN-13 9781805121022
Pages 240 pages
Edition 1st Edition
Languages
Authors (2):
Bahaaldine Azarmi Bahaaldine Azarmi
Profile icon Bahaaldine Azarmi
Jeff Vestal Jeff Vestal
Profile icon Jeff Vestal
View More author details

Table of Contents (17) Chapters

Preface Part 1:Fundamentals of Vector Search
Chapter 1: Introduction to Vectors and Embeddings Chapter 2: Getting Started with Vector Search in Elastic Part 2: Advanced Applications and Performance Optimization
Chapter 3: Model Management and Vector Considerations in Elastic Chapter 4: Performance Tuning – Working with Data Part 3: Specialized Use Cases
Chapter 5: Image Search Chapter 6: Redacting Personal Identifiable Information Using Elasticsearch Chapter 7: Next Generation of Observability Powered by Vectors Chapter 8: The Power of Vectors and Embedding in Bolstering Cybersecurity Part 4: Innovative Integrations and Future Directions
Chapter 9: Retrieval Augmented Generation with Elastic Chapter 10: Building an Elastic Plugin for ChatGPT Index Other Books You May Enjoy

Semantic search on our logs

In this section, we will focus on transforming the expanded logs into vectors in Elasticsearch and then implementing a semantic search functionality on top of the vectorized content. We do this because—remember—our logs are now stored in human-readable language, so we can apply to them the principles of NLP and semantic search we saw earlier.

Building a query using log vectorization

The following code takes the sequence of expanded logs to build a bulk indexing query for Elasticsearch:

# Generate the sequence of JSON documents for a bulk index operation
bulk_index_body = []
for index, log in enumerate(batchCompletion):
document = {
	"_index": "logs",
	"pipeline": "vectorize-log",
	"_source": {
		"text_field": log, "log": logs[index]
	}
}
bulk_index_body.append(document)

The code then executes the bulk indexing operation using a Python helper. Note that we do not...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}