Elastic Ebook Building Ai Powered Search Experiences

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Building AI-powered

search experiences
A blueprint for success with search

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 1
Table of contents
The (search) construction zone 3 Monitoring and analysis 27

Search relevance 4 Analyzing search behavior 28

Vector search 5 Monitoring via observability 29

Generative AI 7 Application performance monitoring 30

Retrieval-augmented generation 9

Community 31

Data and data ingestion 12


The house that search built 32
Structured data 13

Unstructured data 14

Ingestion 18

Personalized user experiences 21


Semantic search 22

Data privacy and access controls 25

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 2
The (search) In the end, no two homes or search experiences are

construction zone
alike. Especially after you’ve “lived” in them for a while,
maintained them over time, and added those personalized,
special touches to make them into “home.”

Building search for your app or your content and building a This guide — a blueprint of sorts — touches on the various
house have a lot in common. Communication, planning, and considerations for building in the age of AI, creating a solid
prep are paramount. The foundation is critical for a long- foundation for successful search experiences.
lasting, sturdy structure. Architecture plays a big role. What’s
happening behind the scenes — or inside the walls, if you will
This guide will
— keeps everything operating smoothly: maintenance, fine- also make quite
tuning, upkeep, and updates. The little, personalized details a few (hopefully
can make all the difference. And so on. helpful) home-
building analogies
along the way.
Technology continuously redefines what homeowners and
search users expect. Modern homes with efficient, intelligent
systems and materials. Smarter search experiences that move
beyond simple, keyword-based searches toward AI-powered
relevance and narrative response that draw ever closer to
human-like understanding.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 3
Search relevance
When a home’s foundation isn’t well built, it can create all sorts Traditional search relies on keyword matching
of structural integrity issues for the house built on top of it. to provide results that align with a user’s query.
The same is true for search relevance, which is the all- Users need to know the exact keywords to
important foundation of any well-built search experience. get optimal results and then must sort through
those results to choose the one that looks like
Search relevance is the measure of how well search results the one they need.
align with the user’s intent and expectations. It’s not just
about finding the correct information but also about ranking AI, however, is quickly changing the way search
the results in a meaningful order and highlighting the relevant experiences are measured. With AI and machine
snippets. Or it can provide direct, helpful answers in a human- learning (ML) techniques, you can build more
like, narrative format in the case of generative AI. accurate search tools that improve relevance,
drive personalization, better understand natural
Relevance is not only complex but also a bit of a gray area. language queries and user intent, and get closer
What is relevant to one person may not be relevant to another, to providing human-like responses.
and queries can be phrased in many different ways. Without
additional context, it can be challenging to understand
precisely what kind of answers your search users are looking
for. And relevance is tied to personalization: Search results
that take into account a user’s personal preferences can make
choices feel more relevant.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 4
Search relevance

Vector search
Vector search, a fundamental feature of vector You enhance the vector search experience further by
databases, is a key component for building combining vector search with BM25 or SPLADE “sparse”
AI-powered search. vectors to provide a multimodal search experience that
allows you to rank by vector similarity while providing
Where traditional search relies on mentions of keywords, better rankings for text.
lexical similarity, and the frequency of word occurrences,
vector search utilizes the power of ML and AI to Vector search can also be used to augment large
understand the semantic relationships between words language models (LLMs) and generative AI applications,
and documents. This means that rather than relying on as it enables question-answering systems by converting
keyword matching, vector search creates a mathematical documents into text embeddings and delivering
representation of documents and queries, enabling it accurate answers.
to understand the context, relevance, and similarity of
different pieces of information.

Ultimately, it allows for the comparison of documents or


data points that may not have any explicit connections
or relationships. For example, you could use associations
made by vector search to find (and suggest) products
that are similar to a product in which a user previously
showed interest.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 5
Search relevance

Vector databases
Vector databases are ideal for models. These embeddings, known While it might sound complex, vector
grappling with the task of managing as “dense” vectors, take the form databases have been created with
unstructured data and extracting of numerical representations of developers in mind, as they use APIs
meaningful insights from it — and for data objects, which can be fed to enable a user-friendly interface
those who want to ensure they are into ML algorithms to determine to simplify the vector search
building an agile search experience. semantic similarity. experience. There are a number of
other benefits to vector databases:
A vector database is a data These embeddings also enable
management solution that enables vector databases to index and Scales with growing data volumes
metadata storage and filtering, is search across a massive dataset
Supports real-time data updates
scalable, allows for dynamic data of unstructured data and semi-
that allow for dynamic changes to
changes, performs backups, and structured data (​​data that does
the data
offers built-in security features. not conform to a data model
but has some structure). Vector Handles the routine operation of
These databases are designed to databases are built to manage backing up all the data stored in
store and manage unstructured vector embeddings and therefore the database
data, such as text, images, or audio offer a complete solution for the
in vector embeddings, also known management of unstructured and
as high-dimensional vectors, which semi-structured data.
are generated by LLMs and other AI

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 6
Search relevance

Generative AI
Generative AI, once the domain of science fiction and
theory, is becoming part of everyday life for many tasks.
While the hype surrounding this technology until now
has been limited to tools such as ChatGPT, DALL-E, and
Image similarity search
Bard, few generative AI use cases have driven as much
A popular use case is users searching by image enthusiasm as generative search.
and finding similar images available in your
dataset. It uses k-nearest neighbor (kNN), a Organizations looking to harness the power of generative
popular algorithm to achieve this, which finds AI need a model that is tuned for their enterprise
the k-nearest vectors to a query vector. environments rather than the ones consumers use, as
these are limited by public training data and lack domain-
However, on the large data sets you’d typically specific data, language, and content.
process in image search applications, kNN
requires very high computational resources Using a generative AI model trained on relatively generic,
and can lead to excessive execution times. As a public data also raises concerns regarding data security,
solution, approximate nearest neighbor (ANN) access controls, privacy, and bias — where an AI model
search sacrifices perfect accuracy in exchange produces content based on data sets that contain
for executing efficiently in high-dimensional human biases.
embedding spaces, at scale.
For development teams, creating generative search
experiences might seem like a goal out of reach due to the
complexities surrounding LLMs and generative AI. You’re
not alone.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 7
Search relevance

Some approaches to consider:


Create and train a domain-specific model from scratch
However, this approach requires enormous financial resources, access to considerable
computing power on specialized chips, and specialized skill sets in artificial intelligence. Even if
you can find the budget and the AI skills, finding vast volumes of high-quality training data for
an LLM remains a challenge.

“Fine-tune” training of an existing LLM


Add specific domain content to a system that is already trained on general knowledge and
language-based interaction. This approach typically requires much less data — usually only
hundreds or thousands of documents, rather than millions or billions — and less computing time
than creating a new model from scratch. It’s not without its limitations, however. Although it
requires less computing power, it can still be an expensive task to undergo. Additionally, some
LLM vendors (for example, OpenAI) do not allow fine-tuning on their latest LLMs, such as GPT-4.

Supplement text generation with proprietary data sources


To overcome the challenges presented by generative search, organizations can connect
generative AI models with their proprietary data to improve the contextual accuracy of outcomes.

This will help you move past the limits of traditional search and leverage data more effectively
and deeply. You can apply it to conversational apps that can answer complex questions, produce
accurate summaries that synthesize many sources, and help people get the information they
need, faster.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 8
Search relevance

Retrieval-augmented generation A framework for AI-enabled search


Retrieval-augmented generation (RAG) is becoming a
Private data
preferred method of solving many of the problems (and
high costs) inherent to generative AI. It’s a technique A corpus of private or proprietary information,
that fuses LLMs and information retrieval techniques, such as internal company documents, policies,
or business transaction data.
enabling AI interactions that leverage your organization’s
proprietary data.
Retrieval technology that can implement RAG
In a nutshell, the AI framework bridges the gap between
Keyword search, vector search, or a hybrid
LLMs that power generative AI and private data sources.
of the two finds relevant information from
With RAG, a retrieval model is used to find relevant existing private information sources.
information from existing private or proprietary information
sources while the generative model takes the retrieved Uses semantic capabilities to infuse relevant
contextual data into a prompt before it’s sent
information, synthesizes all the data, and shapes it into a
to an LLM.
coherent and contextually appropriate response.
Enhances the LLM’s output without having to
RAG also provides powerful semantic capabilities to infuse retrain the model.
relevant contextual data into a prompt before it’s sent to
an LLM. It stores external domain-specific knowledge for LLM for generative AI
improved result quality, which means you can combine
Synthesizes retrieved information into
traditional search results with generative AI to offer
a contextually appropriate response.
question-answering capabilities.
Responds to a prompt with semantically
relevant responses, often based on past
queries and context.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 9
Case Study: CISCO
Cisco Systems builds Before
technology used by more
11,000 support engineers needed search tools to retrieve content from millions
than 87% of the world’s of documents to help resolve the more than 2 million service requests received
Fortune 500 companies. each year. Search results accuracy at the speed at which results are returned
Using Cisco’s website is critical. A delay of just half a second can impact the website click-through
search function, visitors rate or the customer experience when in touch with a support engineer.

can find information from


a collection of hundreds After
of thousands of files of
Cisco reimagined their customer service experience through a new AI-
web pages, documents, driven enterprise search architecture. Support engineers can use the search
and technical, product, tool to quickly retrieve documentation applicable to the customer service
and corporate resources. request, saving as much as 5,000 hours per month of their time. Embracing
AI-powered search also enabled Cisco to revamp its website search for
Search accuracy and
end users. Now, when a search query is entered, a drop-down list of
relevancy are critical.
autosuggestions appears that updates in real time as more characters and
words are typed. This includes common questions that reflect search intent
and enable the searcher to find relevant information more quickly.

73% Faster response time


for search queries Read the full story

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 10
Search relevance

TL;DR: Benefits of retrieval-augmented generation (RAG)


Contextual consistency: The retrieval step helps ensure that the generated output is
contextually relevant and consistent with the provided input and the retrieved context.

Improved accuracy: By retrieving relevant information first, RAG can provide more
accurate responses, especially in information retrieval or question-answering tasks.

Controllability: The retrieval mechanism allows you to control the scope of the generated
responses by choosing the appropriate retrieval database or providing specific queries.

Engagement: RAG-based search experiences are highly engaging for the people who use
them. Enriched by nuance and context from internal private data, RAG-based systems can
deliver insightful and engaging responses.

Reduced generation bias: By using retrieved context, RAG can help mitigate some of
the generation biases commonly observed in pure generative models.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 11
Data and data ingestion
Your home’s plumbing is a convenience that’s very difficult to live without.
Easy access to drinking water, restroom facilities, and clothes-washing
options are critical, even life-saving, benefits. The data that feeds your search
experience is quite similar.

The data might be messy, incomplete, siloed, or otherwise not accessible,


which makes the experience worse for your users. To remedy this, an ingestion
pipeline (plumbing reference intended) can ingest, enrich, transform, and
sync the data your users will search over. Without these critical data ingestion
mechanisms, you don’t have much of a search experience. APIs, web crawlers,
connectors, and pipelines give you the tools to gather and integrate all the
data you need to search.

Before we dive into the ingestion tools, let’s take a look at the types of data
you’ll be dealing with.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 12
Data and data ingestion

Structured data
Much of an organization’s data will take the form of structured data. This is highly organized and formatted, so it can
be quickly processed by machine learning algorithms and humans alike. Examples of structured data include metrics,
dates, names, ZIP codes, and credit card numbers.

Green flags Red flags

Helps to interpret customers’ search behaviors with data Limited and can only be used for its
points like their names, purchase histories, and geolocation. intended purpose.

Enables customer relationship management (CRM), Can also be of low quality due to the huge
where businesses manage customer relationships with amounts of data collected by organizations,
relational databases that can analyze customer behavior. which is often synonymous with data
duplicates or data that is no longer relevant.
Can be easily stored in relational databases, NoSQL
databases, data warehouses, data lakes, in-memory
databases, and more, thanks to its organized nature.

Takes up less space than unstructured data.

Easier for machine learning algorithms to crawl.

Often produces better, more accurate business


intelligence due to its easy-to-parse nature.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 13
Data and data ingestion

Unstructured data
Unstructured data is abundant in organizations — and it’s constantly being generated.

80%
Unstructured data accounts
430%
Unstructured data volume will
for 80% of existing data.* grow by 430% from 2018 to 2025.*

As its name suggests, the term unstructured data


typically refers to data that doesn’t follow conventional
data models and is typically stored in its native format.
Unstructured data is generally categorized as qualitative
and can be human- or machine-generated.

Examples of unstructured data include information


gathered from Internet of Things (IoT) devices, such as
ticker or sensor data; textual data, such as emails and
invoices; scientific data, such as machine-generated
space exploration or seismic reports; and healthcare
data and imaging, such as MRIs, X-rays, and CT scans.

Source: Unstructured Data Storage [UDS] Survey, IDC, 2021


*

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 14
Data and data ingestion

Unstructured data

Green flags Red flags

Often contains rich, detailed information that Requires analysis to be turned into valuable insights.
isn’t available in structured data.
Unorganized and high in volume, making it more
Helps enterprises understand their customers challenging to analyze.
and market shifts better to train natural language
Difficult to manage manually.
processing (NLP) models and provide predictive
data analytics. For example, ecommerce Many databases and tools cannot handle the
businesses can track customer interactions volume and variety.
and collect real-time data, helping to identify
Specific tools and tech are often needed to store
spending patterns and customer behavior,
and process its exponentially growing data volumes.
create personalized experiences, and inform
pricing strategies. Quality can also be inconsistent. It often contains
errors, inconsistencies, or irrelevant information that
Can provide businesses with a deeper
can make it challenging to get accurate information,
understanding of their customers’ intent
particularly when used in search.
and behavior.
Reprocessing or cleaning unstructured data
to improve its quality can be a time-consuming,
complex task.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 15
Data and data ingestion

If RAG and AI search are so good, why is keyword search still around?
Keyword-based, or lexical, search has been around for decades, and it remains an
important piece of the overall search experience puzzle. Even while advanced, AI-enhanced
techniques are becoming more commonplace.

Lexical search is obviously still a great fit for searches that demand exact matches, such as
finding product SKUs, error codes, user IDs, support tickets, code snippets, and so on.

One other reason keyword search remains popular is simply the number of search products
and apps that are in use that rely on keywords. It’s not easy, or sometimes just may
not be necessary, to move these applications to new approaches such as vector
or semantic search.

When you pair keyword search with vector search and semantic
search capabilities, you get the best of both worlds: exact
matching relevance, plus natural language understanding that
can gauge user intent. This approach may be necessary if you
want to combine newer data with existing systems and data.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 16
Data and data ingestion

CHEAT SHEET

How to manage and analyze unstructured data


By nature, unstructured data has no predefined structure that enables easy management and analysis. So, in order to
analyze it, you first need to manage it by defining a structure, which allows you to store, organize, and secure it.

A variety of storage technologies and data processing methods enable you to store, manage, and analyze unstructured data:

Data processing methods Data storage technologies

Natural language processing (NLP) Data lakes


This technology focuses on the interaction Due to its variety and volume, unstructured data
between computers and humans through natural can be stored in data lakes or where the data is
language. The goal of NLP is to read, decipher, created (at “the edge”). Data lakes are suited to
understand, and make sense of human language large volumes of various types of data.
in a valuable way.
Content management systems (CMS)
Machine learning (ML) As an application, a CMS enables businesses
ML uses statistical techniques to identify to store, retrieve search, index, and publish
patterns in structured and unstructured data to unstructured data on the web.
make predictions or decisions.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 17
Data and data ingestion

Ingestion
Now that you’ve considered what data you want to search, the next step is to bring it to your
search engine. Data ingestion is the process of collecting large, assorted data from multiple
sources — or your sources of truth. This can be a taxing process. Increasing volumes and
varieties of data sources make collecting, compiling, and transforming data into something
cohesive and usable a persistent challenge. For example:

Data integration across disparate sources: Integrating information from multiple


systems across the entire enterprise means synchronizing different data requirements
and standards, which can be chaotic. Data may be stored in various formats and
held in different locations, such as relational databases, webpages, file systems,
or network drives.

Privacy concerns: There may also be metadata that you want to ensure you’re not
showing to end users, or personally identifiable information (PII) may need to be cleaned
out before it is ingested.

Erroneous data: It’s also likely that data will contain errors, inconsistencies, or missing
values that need to be identified and corrected before ingestion.

Speed and freshness of data: How many days or months of business records do you
want to keep in a layer that enables rapid search? What is the cutoff point for data to go
into archival layers that are slower but also more cost-effective?

Manual ingestion: Writing code to ingest this data and manually creating mappings for
extracting, cleaning, and loading data can be cumbersome.

Cost: The infrastructure you need to support the various data sources and tools can be
costly in the long run.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 18
Data and data ingestion

API

Depending on the data sources, there are a variety of Web crawler

different ingestion mechanisms you might choose to use.


Let’s take a look at each.
Web crawler API
Connectors
Take advantage of API endpoints to programmatically
build an ingestion pathway between your data source
API
and the app that uses that data. Use standard CRUD
operations to add, update, and remove data as needed.
Web crawler
Look for client libraries, and sometimes search, sort, or
Crawling involves importing and loading data from one or
API Ingest pipelines
filter capabilities that programming language native APIs
more data sources and making it available in a structured
provide to simplify the process.
format that can be indexed and searched by a search Connectors

engine. This process also involves repeatedly pulling in


data on a real-time or regular batched basis to ensure that
Connectors
search results are up to date. A web crawler is a digital
search engine bot that uses copy and metadata to dis-
Connectors
cover and index site pages. It “crawls” a specified domain Ingest pipelines
Connector libraries sync data from an original data
to learn what a given page is about and then indexes the
source to your required index — for example, any network
pages and stores the information for future searches.
Ingest pipelines drive or a PostgreSQL database. Connectors extract the
original files, records, or objects and transform them into
your desired documents.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 19
Connectors

Data and data ingestion

Ingest pipelines

Ingest pipelines
With pipelines, you can perform common transformations on data before storing it.
All ingest pipelines are composed of an ordered list of processors, which define the
behavior of the pipeline. These can be particularly helpful by providing a layer of
customization and post-processing of documents. For example:

Providing consistent extraction of text from binary data types

Ensuring consistent formatting

Providing consistent sanitization steps (removing PII like phone numbers or SSNs)

Increasingly, pipelines incorporate ML processors, which can apply inference as data is


ingested. For example, inference tasks can be used to compute mood or sentiment from
a data set of user reviews.

Production-ready pipelines can be a lot of work to set up and manage from scratch.
Considerations such as error handling, conditional execution, sequencing, versioning,
and modularization must all be taken into account.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 20
Personalized
user experiences
Where you live is more than just a structure, house, or building.
It’s home. Personalizing our spaces creates a comfortable vibe
and a coziness. Maybe you use Feng Shui practices to harmonize
with your home’s environment. Maybe it’s mood lighting, or a cozy
fire, or your favorite artworks. The user experience for search is
much the same. You want to make your customers, prospects, and
users feel comfortable, with search capabilities that feel familiar,
useful, quick, guiding, and relevant. Help them find exactly what
they need — and maybe a few things they didn’t even know they
needed. Users will definitely notice if the experience feels clunky,
serves up not-so-relevant results, or doesn’t quite understand
natural language.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 21
Section title -user
Personalized remove
experiences
if not needed

Semantic search
Thanks to semantic search and LLMs, modern search engines have become
more intelligent and can now produce more relevant and personalized search
results than ever.

Semantic search applies user intent and the meaning — or semantics — to


words and phrases to find the right content. It goes beyond keyword matching
by attempting to understand what a user is really looking for — based on a
number of factors such as their location, search history, and trends — in order
to provide them with the most relevant results possible.
Executive Tip:
This creates a personalized experience whereby search results are ranked It’s also vital that expectations
based on the user’s previous searches or that are relevant to the user’s are managed — internally.
location. For example, when you type “restaurants” into Google, it will display Many organizations building
well-rated results that are close to your location or that match the type of search experiences tend to be
cuisine you’ve searched for previously. hampered by a lack of data
volume, which can limit the
This level of personalization seems obvious to us now. Of course we mean number of dimensions that can
“restaurants near me” when we search “restaurants.” It’s what search users be added to search queries.
have come to expect across the board. Yet, knowing where to begin when it Similarly, if implementing AI-
comes to building a semantic search experience can be difficult. driven features, it’s important to
remind your boss and C-suite
Our recommendation: determine whether your organization has the volume execs that a machine learning
of data necessary to enable a super-personalized experience, first. You need model is only as good as the
access to data — and lots of it. This is the only time we’ll say “Less isn’t more.” data it’s trained on.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 22
Case Study: LABELBOX
At the forefront of the AI revolution, Before
Labelbox offers a collaborative
Labelbox Catalog, one of the company’s most popular tools,
data training platform that creates searches and analyzes unstructured data for improved
and manages labeled data for ML training model performance. For years, Catalog ran on top of a
applications. Rather than companies PostgreSQL database, which made it difficult to build filters for
building their own expensive tools more accurate results. Searches were also time-consuming — in
some cases, it took up to 20 seconds to respond to a request.
to create or manage training data,
customers use Labelbox.

This solves the problem of taking After


artificial intelligence and ML Customers can now execute complex searches, while
initiatives from research and sophisticated analytics enable them to make more accurate
decisions when curating data to label. Search times are down to
development into production. In
roughly one second.
addition to working directly with
their customers, the company’s main
product makes it easy to create and
manage labeled data, enabling rapid
deployment of AI applications. 95% Reduced search
response time Read the full story

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 23
Personalized user experiences CHEAT SHEET

Search UX best practices


Expectations for an advanced level of personalization
mean that users have also come to expect advanced Users may see it as a glaring miss if your search experience
search features as standard. This includes add-ons doesn’t include these foundational features:
such as autocomplete and the ability to filter and sort
Typo tolerance: Ensure your search accommodates
to drill down to the exact results they’re looking for.
your users’ spelling challenges and clumsy typing
(especially on mobile devices).
For example, the concept of filters is now so
commonplace that people expect them when they go Autocomplete: As users type in a query, give them the
to any search experience. Ecommerce buyers want to convenience of prefilled suggestions to choose from.
choose who’s selling them the item, what color it is,
and what size it is. Synonyms: Make it convenient for users to get
relevant results, whether they search for mountain,
However, implementing filters to help users narrow peak, or summit.
down search results based on different attributes
— such as categories, dates, and prices — requires Filtering/faceting: Give users the ability to filter and
careful design and development. sort to drill down to the exact results they’re looking for.

Curations: Pin, hide, or promote the content results


Search APIs are the most straightforward way
you’d like to steer users toward.
to integrate modern search capabilities into your
website or application. They enable custom search
Pagination or infinite scroll: Offer users pagination or
interfaces and configurable search components
the option to scroll endlessly depending on the results
with just a few lines of code, such as rich filtering you are displaying.
capabilities, search-as-you-type, and auto-
paginated results. They also tend to include support “You might also like” items: Especially in ecommerce
for different language clients, which means you applications, additional suggested or recommended
can interact with REST APIs with pretty much any items are a helpful way to create additional
programming language you wish. revenue opportunities.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 24
Data privacy and
access controls
Parallels between data security and home security are pretty apparent. We want to feel safe
in our homes and ensure that our possessions are protected. Likewise, users of your search
applications want to make sure their data is safe and that standard privacy protocols are
followed. And you want to be sure that your organization’s private data is protected as well.

This adds another layer of complexity for developers hoping to build an agile search experience.
The rise of generative AI, which looks set to revolutionize enterprise search, has brought
with it a number of privacy and security challenges due to its ability to process personal data
and generate potentially sensitive information. This means that businesses, and developers
experimenting with AI-driven search experiences, must be vigilant in safeguarding sensitive data
to avoid potential disasters.

For example, suppose training data contains sensitive data, like medical records, financial
information, or other identifiers. In that case, there’s a risk of unintentionally generating sensitive
information that violates privacy regulations across jurisdictions and puts individuals at risk.
What’s more, if proper security measures are not in place, generative AI tools may be vulnerable
to data breaches, resulting in unauthorized access or disclosure of sensitive user information,
which again could lead to privacy violations and the potential misuse of personal data.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 25
Data privacy and access controls

Developers must also ensure they are balancing innovation with privacy protection to avoid
potential misuse of sensitive information. This includes incorporating advanced anomaly
detection and monitoring systems and carrying out continuous security audits to ensure
adherence to relevant data protection regulations.

Document-level permissions are another essential consideration when building an internal


enterprise search experience. These permissions are used to manage various pieces of content
based on an individual or a team’s attributes, such as private HR documents, procurement
contracts, etc. Document- and field-level permissions can be combined with role-based access
controls (RBAC) to create very effective mechanisms for managing how data is accessed.

Implementing these features and carrying out various privacy assessments isn’t a task owned
by developers alone. Work with IT security, IT maintenance, information systems managers,
and analysts across the IT organization. Third parties can also help scale and ensure your
organization automatically complies with the growing list of data privacy regulations.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 26
Monitoring and analysis
You can have incredible, well-designed, well-decorated spaces in your house.
But without well-maintained heating and cooling, plumbing, and electricity,
you’re sitting in a dark room that’s too hot or too cold, with no running water,
and all your food has gone bad in the fridge.

Search is no different. Regular monitoring and analysis of search relevance


and user activity help to make sure users are finding exactly what they need.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 27
Monitoring and analysis

Analyzing search behavior


Search users leave behind a treasure trove of actionable
data — offering rich search analysis opportunities. Search Tech Tidbit: How to measure
analytics reveal what users on your website are searching your site’s search effectiveness
for, results they are clicking on, how much time they
Click-through rate (CTR): When applied to site
are spending on a page, and how those journeys are
search, CTR refers to the ratio of users who
translating into conversions.
clicked on a search result and the total number
of users who viewed search results. You can use
Site search analytics can unearth insights such as
this rate to find out whether people have found
zero-result search queries (that is, search queries that
interesting and relevant content in their search.
produce no results at all), helping you to know which gaps
you need to plug. Visitors might be searching for content Popular search terms: By finding out what’s
topics you haven’t even considered writing about yet, or popular with your search users, you can create
products you haven’t yet decided to stock or build. This more valuable content and enhance the UX and
type of information can be shared with your business UI of your website.
stakeholders like marketing and product development.
No-hits keywords: If a user gets no results after
executing their search query, it can either mean
Developers could consider a more feature-packed,
that your website lacks content or that your
out-of-the-box solution that offers data collection, metrics,
search isn’t accurately determining what the
and visualizations of users’ search behaviors. By doing so,
user is after.
you can capture detailed analytics automatically and can
analyze these results in an easy-to-navigate dashboard. Common spelling errors: What are the usual
search terms that your users are misspelling? When
people search for “spaekars” instead of “speakers,”
they still expect to see a full search results page,
never mind the spelling error in the query.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 28
Monitoring and analysis

Monitoring via observability


Observability, which incorporates application performance
monitoring (APM), is a holistic, dynamic practice to help
you understand how your complex systems work.

The term observability refers to the collection and analysis


of data, such as logs and metrics, to provide detailed Benefits of observability
insight into the behavior of applications running in your
Performance monitoring that
environments. It can be applied to any system that you
leads to speedy resolutions
build and want to monitor.
Complete and instant visibility
To handle complex systems and logs upon logs of listless
Elimination of tool silos
data, work with your DevSecOps team to help proactively
diagnose, analyze, and trace issues back to their origins. Better user experiences

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 29
Monitoring and analysis

Application performance
monitoring (APM)
APM is another tool that can make ongoing maintenance
a less daunting task. APM solutions collect, monitor,
and analyze telemetry data from websites and services, Benefits of APM
providing development teams with end-to-end visibility
Increase stability and uptime
across their applications so they can understand
application and service dependencies and address any Reduce incidents
errors or slowdowns.
Resolve issues faster

Teams can leverage these insights to get on top of any Release high-quality software
issues, rather than waiting for users to flag the issues —
Identify infrastructure improvements
or, worse, leave your site and never return. Developers can
also set up alerts for degradations in user experience in Improve productivity
order to make more informed decisions on where
Create better user experiences
to make improvements.
Drive revenue
APM solutions also store and utilize historical data to
surface trends and detect outliers for technical key
performance indicators (KPIs), such as latency and
throughput, as well as business KPIs.

Want to share best practices with your DevSecOps team?


Download the Observability Guide now

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 30
Community
Friendly neighbors can make or break the neighborhood where you live. And a thriving, helpful
software user community can also go a long way toward solving tough issues, generating ideas,
and ensuring success with your search experiences.

By joining the Elastic community, you gain a network of support as you build your experience
with Elasticsearch.

With a front-row seat in the Elastic community, you and your team can benefit from the shared
knowledge of other developers on the same journey:
From the earliest days, our
community relied on three
Elastic Community products (which are now part of
one experience) — Elasticsearch,
Elastic Contributor program and awards
Logstash, and Kibana, or ELK
for short. The ELK Stack, as it
Elastic Community forums
became known, was represented

Elastic Community Slack workspace by yours truly, Elky.

Elastic YouTube channel

No matter where you turn, you’ll see Elasticsearch


pros and beginners helping each other out.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 31
The house that search built
As this guide has demonstrated, building an agile enterprise search experience
— much like building your dream home — can be a challenging yet rewarding process.

Elastic can help. With one of the industry’s most popular search and analytics engines —
Elasticsearch — we’re bridging the gap between LLMs and search to enable you to build
custom generative AI applications with your company’s data.

The Elasticsearch Relevance Engine™ (ESRE) powers


generative AI solutions for private data sets with a vector
database and machine learning models for semantic
search that bring increased relevance to more search
application developers. ESRE combines the best of AI
with Elastic’s text search, equipping developers with a
full suite of sophisticated retrieval algorithms and the
ability to integrate with LLMs, including Elastic Learned
Sparse Encoder (ELSER). This Elastic-trained model
doesn’t require fine-tuning of your own data, making it
adaptable for various use cases out of the box.
Ready to build better search?
Watch the quick start guide

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 32
Thank you.

elastic.co | © 2023 Elasticsearch B.V. All rights reserved. Building AI-powered search experiences 33

You might also like