Want more control over your search setup? Discover our flexible infrastructure pricing.

Go to homeMeilisearch's logo
Back to articles

On-site search: Definition, implementation, best practices & more

Understand what on-site search is, how it works, its benefits, how to implement it, best practices, and more.

07 Aug 202516 min read
Ilia Markov
Ilia MarkovSenior Growth Marketing Managernochainmarkov
On-site search: Definition, implementation, best practices & more

When users land on your website, they’re typically looking for something specific. If they can’t find what they need quickly, they’ll leave.

Whether you run an e-commerce store, a SaaS platform, or a content-based site, on-site search helps users reach the content, products, or features they need.

If done right, on-site search increases time on site and improves conversions. If done wrong, it frustrates visitors and sends them to your competitors.

This article will dive into what on-site search is all about. By the end of this piece, you will learn:

  • How on-site search works
  • The features and challenges of on-site search
  • How to add an on-site search feature to a website
  • How to improve the on-site search of a website

Let’s begin.

On-site search (also called internal search or site search) is a search feature within a website that allows users to find internal website content.

For example, you want to buy a wireless game console on Amazon. Rather than clicking through various product categories, you simply type ‘wireless game console’ in the search bar, and the game console products available on Amazon pop up.

Amazon on-site search.png

So, how exactly does on-site search work?

How does on-site search work?

On-site search may appear simple, but a lot is happening behind the scenes. Here is a step-by-step process of how an on-site search works.

How on-site search works .png

  1. Content indexing: An index represents a structured, searchable database of website content – product descriptions, blog posts, documentation, or similar. It maps keywords and attributes (e.g., title, category, tags) to specific pages or records. Indexing happens before any searches are made, enabling fast lookup and filtering later.
  2. Query input: The search process starts with the user typing a term into the search bar. This can be anything from a single word, a question, a product name, or a vague phrase. The search engine captures this query exactly how the user types it and sends it off for processing.
  3. Query processing: Query processing can involve lemmatization, punctuation removal, stopword removal, etc. Depending on how the search system is built, it could also correct potential typing mistakes and try to understand the intent behind the search.
  4. Record matching and retrieval: After processing the query, the system compares it to the indexed content for potential matches. This is where the core of the search happens – matching what the user typed into the search field with the content in your index.
  5. Results ranking and display: Once the search engine finds possible matches for a search, it ranks them. The best results (based on relevance or popularity) appear at the top of the results page, hopefully allowing the user to see exactly what they need.

Let’s see why on-site search is crucial for websites today.

Why is on-site search important for websites?

On-site search helps reduce friction and keeps users engaged by guiding them directly to what they’re looking for.

Here are some key benefits of implementing on-site search:

  • Improved UX: On-site search improves UX by allowing users to quickly find content without navigating endless menus, enhancing overall experience.
  • Higher conversion rates: When users visit our site, we want them to act. The quicker they find what they're looking for, the more likely they are to convert. Fast, helpful searches increase conversions.
  • Data insights: Website owners can use search data to see what users search for most, helping them decide which products or content to promote or add. If many users search for something you don't offer, it's an opportunity to provide it.
  • Reduced support requests: A well-functioning search helps users find answers on their own, which means fewer repetitive questions for your support team to handle.

Now, let’s see the features of a good on-site search.

What features should a good on-site search have?

What separates a good on-site search from a bad one is mainly its features.

Here are some features of a good on-site search.

Features of a good on-site search.png

Autocomplete suggestions

A good on-site search should suggest results as the user types. For example, when someone starts typing ‘hiking,’ the search bar might already show suggestions like ‘hiking shoes,’ ‘hiking gear,’ or ‘hiking outfit.’ This helps users find what they are looking for more quickly, without needing to type the entire phrase.

Typo tolerance and error handling

We are all prone to making mistakes while typing. A strong on-site search engine should be able to recognize these errors and still return accurate results.

For example, a user might enter ‘hking boots’ while typing in a hurry. They should get relevant ‘hiking boots’ results. This ensures that small mistakes do not prevent users from finding the right content or product.

Search filters and faceted navigation

A good on-site search should support filters. Meilisearch, for instance, uses faceted search, allowing users to find results based on categories.

This enables users to refine their search even more, such as when they are looking for specific product brands, colors, sizes, and more.

Synonym recognition and language flexibility

A reliable on-site search should understand that different users might use different words for the same item. If a website lists a product as a ‘sofa,’ users who search for ‘couch’ should still see that item. This is part of intelligent search, which focuses on understanding meaning, not just exact keywords.

Instant, high-speed results

No one enjoys waiting for results to load. A search experience should return results instantly. Quick performance helps users stay focused and reduces the chances of them bouncing off out of frustration.

On-site search works well, but it isn't always perfect. Here are common issues that can frustrate users if not managed properly:

  • Poor relevance: When searching the site, the user expects the most useful results to show up first. If the results do not match what the user is looking for, the user will likely bounce off the site.
  • Slow search: Most people lack patience when it comes to searching. If results take too long to load (even just a couple of seconds), it can drive users away. The faster the speed, the better the user experience.
  • Lack of analytics: Many websites today do not track what people are searching for. As a website developer or owner, improving your site without search data is difficult. You may also miss out on valuable insights about search trends and potential gaps in your content.
  • Cannot handle typos: Users make mistakes in search all the time. If a search cannot handle typo errors, misspelled words will lead to empty results or irrelevant pages. This is a bad user experience and is a fast lane to losing potential customers.

Let’s now look at some best practices of on-site search to avoid these downsides.

How to improve on-site search functionality

Here are some best practices to make your search smarter and more useful to your users:

How to improve on-site search.png

1. Make the search bar easy to find

Most sites have their search bar at the top of their page, making it stand out. It should not be hidden behind menus or buried in the footer of the page. If visitors cannot see it immediately, they will not use it.

Etsy homepage.png

Source: Etsy

The search field should be simple or have clear placeholder text, like ‘Search products’ or ‘Find what you are looking for.’

2. Guide users with auto-suggestions

A good on-site search should show popular queries or trending items as the users type, speeding up the process.

Amazon auto-complete.png

Source: Amazon

For example, someone typing ‘lapto’ can bring up ‘laptop bags’ or ‘laptop stands’. This is especially helpful when users are unsure of the exact term or spelling. It is a simple way to boost engagement on your website.

3. Highlight the words they searched for

When users see their search terms highlighted in the results, it gives them instant feedback that they are on the right path. They can easily scan the options and choose the most relevant.

Meilisearch_s search keyword highlights.png

Source: Meilisearch

For example, when typing ‘vegan foods,’ seeing those words pop out in the listings helps them focus and decide faster. This simple detail can make searches clearer and easier to trust.

4. Search should be mobile-friendly

Most people use their mobile phones to browse on the go, so your search functionality should adapt seamlessly to smaller screens: results should load quickly, filters should be easy to scroll or tap, and the experience should feel just as intuitive as on desktop.

5. Have a smart and scalable index

Make sure all relevant content – products, blog posts, FAQs, documentation, categories – is properly indexed. If something isn't indexed, it won't appear in search results, no matter how relevant it is.

As your site grows, use indexing strategies like sharding (splitting large indexes into smaller parts) to keep performance fast and scalable. A clean, complete index is the backbone of any great search experience.

6. Structure content for search visibility

Your search engine can’t return what it doesn’t understand. Use clear titles, descriptive labels, and consistent formatting for products, documents, and categories.

For example, instead of vague product names like ‘H20 750,’ write ‘Plastic Steel Water Bottle 750ml.’ Structured, descriptive content helps the search engine accurately match queries to results.

Various tools and platforms can power on-site search, but they don’t all have the same features.

Here are some popular options that developers use to build fast and reliable search experiences.

1. Meilisearch

Meilisearch homepage.png

Source

Meilisearch is a fast, open-source search engine that simplifies on-site searches. It delivers instant results as users type, handles typos well, and offers smart autocomplete suggestions.

With little configuration, Meilisearch supports powerful features such as filters, facets, and relevance-based ranking. It is lightweight, easy to set up, and integrates quickly with most websites or apps. Whether you are running an online store, a blog, or a large content site, Meilisearch can help your users find what they need.

You can begin your Meilisearch journey by signing up.

2. Site Search 360

Site Search 360 homepage.png

Source

Site search 360 is a powerful and flexible on-site search tool. It is easy to set up and works well across different types of websites. One standout feature is the ability to automatically crawl your site and manage your search index. It has built-in features like autocomplete, typo tolerance, relevance ranking, and custom filters.

3. Elasticsearch

Elasticsearch homepage.png

Source

Elasticsearch is a powerful, open-source search engine known for its speed, scale, and flexibility. It is mainly used by large websites and applications that handle complex data and search queries.

With Elasticsearch, you get full-text search, real-time indexing, typo tolerance, relevance ranking, and support for filters and facets.

It might be more technical to set up than on-site search options, but it gives you deep control over how search works.

4. Algolia

Algolia homepage.png

Source

Algolia is a fast, hosted search-as-a-service platform that delivers instant, relevant results with a great user experience. It has powerful APIs and flexible front-end tools. It also supports features such as autocomplete, typo tolerance, synonyms, filters, facets, and advanced relevance tuning.

5. AddSearch

AddSearch homepage.png

Source

AddSearch is a clean, reliable hosted search solution that makes it easy to add fast, accurate search to your website. It does not require a detailed setup. It automatically indexes your site, so you don’t need to manually index your content.

It has built-in features like autocomplete, typo tolerance, relevance-based ranking, and filtering. You can fully customize the look of the search results to match your site’s branding.

How do you add on-site search functionality to a website?

This section will provide a step-by-step process for adding on-site search functionality using Meilisearch.

1. Run a Meilisearch server

The first step is to self-host Meilisearch. To do that, download the Meilisearch binary from the official documentation. Run it locally with a simple command ./meilisearch.

# Install Meilisearch
curl -L https://install.meilisearch.com | sh
# Launch Meilisearch
./meilisearch

Meilisearch server will run at http://127.0.0.1:7700.

Alternatively, you can run the Meilisearch server using Docker or Homebrew with the command:

# Using Docker (recommended)
docker run -d -p 7700:7700 getmeili/meilisearch:v1.6
# Or using Homebrew
brew install meilisearch
meilisearch

2. Install the JavaScript SDK

The JavaScript SDK allows you to interface with Meilisearch in JavaScript code. You can either use Node package installer or Yarn to install.

npm install meilisearch
# or
yarn add meilisearch

3. Connect to Meilisearch and create an index

An index is a map that connects keys to documents you want to search through. If you have a blog, you might have a 'posts' index. For an e-commerce site, you can create a 'products' index and connect it to a document.

To create an index, open a JS file and enter the following:

const { MeiliSearch } = require('meilisearch');
// Initialize the client
const client = new MeiliSearch({
  host: 'http://localhost:7700',
  apiKey: 'your-master-key-here' // Optional for development
});
// Create an index (like a database table for your searchable content)
const index = client.index('products'); // 'products' is your index name
console.log('Index created:', index.uid);

This should log “Index created: products” in the console/terminal.

4. Add documents to your index

You have to feed Meilisearch your content. Each document should have a unique ID and a list of fields you want to be searchable.

For example, let’s add sample data for a food recipe website that users can search through.

Here is the code snippet:

// Sample document data
const documents = [
  {
    id: 1,
    title: 'Perfect Chocolate Chip Cookies',
    content: 'Learn how to make the ultimate chocolate chip cookies with this easy recipe. These cookies are crispy on the outside and chewy on the inside.',
    author: 'Sarah Johnson',
    category: 'Desserts',
    tags: ['cookies', 'chocolate', 'baking', 'easy'],
    publishedAt: '2024-01-15',
    cookingTime: 25,
    difficulty: 'Easy'
  },
  {
    id: 2,
    title: 'Healthy Mediterranean Salad Bowl',
    content: 'A nutritious and colorful salad packed with fresh vegetables, olives, feta cheese, and a tangy lemon dressing.',
    author: 'Mike Chen',
    category: 'Salads',
    tags: ['healthy', 'mediterranean', 'vegetarian', 'quick'],
    publishedAt: '2024-01-20',
    cookingTime: 10,
    difficulty: 'Easy'
  },
  {
    id: 3,
    title: 'Homemade Pizza Dough Recipe',
    content: 'Master the art of pizza making with this foolproof dough recipe. Perfect for weekend cooking projects with family.',
    author: 'Tony Romano',
    category: 'Main Dishes',
    tags: ['pizza', 'italian', 'dough', 'family'],
    publishedAt: '2024-01-25',
    cookingTime: 120,
    difficulty: 'Medium'
  }
];

// Add documents to the index
async function addDocuments() {
  try {
    const response = await index.addDocuments(documents);
    console.log('Documents added:', response);
    
    // The response includes a taskUid to track the indexing process
    console.log('Task ID:', response.taskUid);
  } catch (error) {
    console.error('Error adding documents:', error);
  }
}
addDocuments();

This should return something in the following format, confirming the documents were added to that index successfully:

Index created: products
Documents added: {
  taskUid: 0,
  indexUid: 'products',
  status: 'enqueued',
  type: 'documentAdditionOrUpdate',
  enqueuedAt: '2025-07-12T22:01:33.547194Z'
}
Task ID: 0

Notice how we included various types of data (strings, arrays, dates, and integers). Meilisearch understands and indexes all these different field types.

5. Configure search settings

This is where you fine-tune how Meilisearch understands and ranks your content. Without this configuration, Meilisearch will search through everything, but it might not prioritize results the way you want.

In the function below, we create configureSearch() to define our search settings.

// Configure which fields are searchable and how they're ranked
async function configureSearch() {
  try {
    // Set which fields to search in
    await index.updateSearchableAttributes([
      'title',
      'description',
      'category',
      'brand'
    ]);

    // Set ranking rules (how results are sorted)
    await index.updateRankingRules([
      'words',
      'typo',
      'proximity',
      'attribute',
      'sort',
      'exactness'
    ]);

    // Configure filterable attributes (for filters/facets)
    await index.updateFilterableAttributes([
      'category',
      'brand',
      'price'
    ]);

    console.log('Search configuration updated');
  } catch (error) {
    console.error('Error configuring search:', error);
  }
}
configureSearch();

This code does three main things:

  • updateSearchableAttributes tells Meilisearch which fields it should search through. Instead of looking at every bit of data (like IDs or timestamps) you focus the search on what matters. Note that order is important, too, so it would prioritize title, then description, category, and brand.
  • updateRankingRules sets the order of ranking stages. For example, exact matches appear first, followed by close matches with typos, and then results where the terms are nearby in the text.
  • updateFilterableAttributes defines which fields users can filter. So if someone wants to see only recipes in the ‘Desserts’ category or posts by a specific author, Meilisearch knows which fields to use for those filters.

Running the code will return ‘Search configuration updated.’

6. Build the front-end search interface

Until now, we have been setting up the engine behind the scenes. In this step, we start building the interface that people will use.

We will create a simple HTML file that will:

  • Load the Meilisearch UMD bundle from jsDelivr.
  • Connect the client to the server at http://127.0.0.1:7700.
  • Wire an <input> so that when you type a query, it runs index.search() and dumps the returned hits as JSON.

Save the code in an HTML file and open the file in a browser.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>MeiliSearch Test</title>
</head>
<body>
  <input id="q" placeholder="Type and press Enter…" style="width:300px" />
  <pre id="out"></pre>

  <!-- 1) Pull in the UMD bundle from the CDN -->
<script src="https://cdn.jsdelivr.net/npm/meilisearch@latest/dist/bundles/meilisearch.umd.js"></script>
  <script>
    // 2) Point the client at your server
    const client = new MeiliSearch({ host: 'http://127.0.0.1:7700' });
    const index = client.index('products');

    // 3) Hook up a simple search on Enter
    document.getElementById('q').addEventListener('keypress', async e => {
      if (e.key === 'Enter') {
        const query = e.target.value;
        try {
          const res = await index.search(query, { limit: 5 });
          document.getElementById('out').textContent = JSON.stringify(res.hits, null, 2);
        } catch (err) {
          document.getElementById('out').textContent = 'Error: ' + err.message;
        }
      }
    });
  </script>
</body>
</html>

When you search ‘chocolate,’ for instance, it returns the document with chocolate.

Finished on-site search.png

Now that we understand how to add on-site search with Meilisearch, let’s see how it can be improved for easy accessibility.

How can on-site search be improved for accessibility?

To build truly inclusive websites, your on-site search must work for all users, including those using screen readers, only keyboards, or assistive devices.

Here are features that would make your on-site search more accessible:

  • ARIA labels: You can use ARIA (Accessible Rich Internet Applications) labels to clearly describe the purpose of every part in the search interface. For example, labeling the search button as ‘search site’ clearly tells the user what will happen when they press it.
  • Keyboard navigation: A user should be able to type in the search field, navigate autocomplete suggestions with the arrow keys, and press ‘Enter’ to search, all with just the keyboard. They should not need a mouse to access and use the search bar.
  • Screen reader support: This ensures that screen readers can detect and announce real-time updates. If your search bar shows live suggestions as users type, those changes should be communicated clearly so that users relying on screen readers will not be guessing. It works like a live autocompletion.

Now, let’s discuss e-commerce on-site search.

E-commerce on-site search is a search function built into an online store. It allows users to easily find products.

A good e-commerce on-site search goes beyond matching keywords. It should understand typos, suggest popular items, and let users filter using different parameters such as size, brand, price, color, rating, etc.

How does on-site search impact e-commerce sales?

A good on-site search should increase sales conversions and the average order value.

Customers are more likely to buy when they can quickly find what they want. According to a Forrester report, users who use on-site search are two to three times more likely to convert than those who browse manually.

This is because on-site searchers often have a clear intent. They know what they want, and if your search gets them there quickly, they can complete the purchase.

A good on-site search also helps increase order value.

For example, someone searching for ‘skincare cleansers’ might see related products like serums or moisturizers, helping the business owner upsell effortlessly.

Best practices for on-site search in e-commerce

In e-commerce, on-site search isn’t just a feature; it’s a key part of the customer journey. A well-designed search can reduce friction, boost conversions, and turn casual visitors into loyal buyers...

  • Product suggestions: Showing product suggestions as users type can speed things up and guide them to what they want, even before they finish their search.
  • Merchandising: An on-site search is like a sales channel. Merchandising allows you to promote specific products in the search results. You can promote seasonal items and feature higher-margin products. In addition, it gives you more control over what your users see and helps align their search with your business goals.
  • Personalization: Personalizing search results based on past behavior, location, or preferences makes the experience feel more relevant. For instance, if someone always shops for organic skincare, a good search will show those items first.
  • Zero results handling: No one likes seeing ‘no results’ when they search. Instead of a dead end, provide suggestions like ‘Did you mean…?’ or show popular items and categories. This keeps the user engaged and gives them another path to explore, even if their first search didn’t give them what they wanted.

Let’s wrap up.

Bringing it all together: building better on-site search experiences

A good on-site search does not happen accidentally; it is designed with the users in mind. When it works well, it helps people find what they want fast, keeps them engaged, drives more sales, and improves customer experience.

Treat on-site search as a tool. It is a key part of the user journey that can turn casual visitors into loyal customers.

Meilisearch is a modern, open-source search engine that delivers fast, relevant, and customizable on-site search with minimal setup. It’s a strong choice for teams that want developer-friendly tools without sacrificing performance or user experience.

Intranet search engines: What you need to know in 2025

Intranet search engines: What you need to know in 2025

Understand what intranet search engines are, how they work, and why they matter, plus key features, benefits, best practices, and more.

Ilia Markov
Ilia Markov06 Aug 2025
Semantic search vs Vector search: Key differences, uses, & more

Semantic search vs Vector search: Key differences, uses, & more

Discover the key differences between semantic and vector search, their use cases, strengths, and how to choose the right approach for your search needs.

Ilia Markov
Ilia Markov30 Jul 2025
Elasticsearch vs Typesense (vs Meilisearch): Which search engine actually fits your needs in 2025?

Elasticsearch vs Typesense (vs Meilisearch): Which search engine actually fits your needs in 2025?

Compare Elasticsearch's enterprise-scale power, Typesense's developer-friendly speed, and Meilisearch's AI-powered simplicity to find the search engine that matches your needs, team capabilities, and growth trajectory.

Ilia Markov
Ilia Markov29 Jul 2025