Search Module Introduction

Brief intro into built-in DocLayer’s Search Module

DocLayer comes with a built-in search functionality powered by the dl-search module. The Search component, which is mounted by default in the Header as soon as you begin working with DocLayer, utilizes this module. While the Search component provides the user interface for searching, the dl-search module manages all underlying search logic and operations.

The search functionality is divided into two main capabilities:

  1. Static search: traditional search functionality powered by the Fuse.js library, where you can search for any content statically.
  2. AI-powered search: Advanced search built as a RAG technology, which can operate entirely locally or utilize remote LLMs (typically via a third-party provider's API). This feature requires a dedicated preparation process and can be enabled/disabled if needed.

How it works

Below you’ll find an overview of the search functionality flow. On the next pages, you can explore how to configure and use the search engine to best suit your needs.

Indexing the content

The first and most important step is the content indexing. Any selected content collection - by default docs - will be scanned, parsed, and indexed into a searchable format. This index is then saved in the public directory to be accessible by the search engine, used both for static and AI-powered search.

As mentioned earlier, static search is powered by Fuse.js. It uses the indexed content to perform searches based on the user’s query; results are then displayed in a search modal. This approach is extremely fast, though it works essentially like an anchor-based list and does not provide any additional contextual information.

AI Assistant assembling

This step applies only if AI-powered search is enabled.

The AI Assistant can operate entirely locally, within the user's browser context, without any additional dependencies like MCP servers. But what does this actually mean? In addition to the standard content index, the dl-search module generates a vector-based representation of that content. To accomplish this, the module (during the runtime) uses a lightweight text embedding model. The resulting vector database is then integrated into the application.