search-client.ts

src/components/search/search-client.ts
import FlexSearch from 'flexsearch'
let sectionIndex: any = null
let searchData: any[] = []
async function loadSearchData(): Promise<any[]> {
if (searchData.length === 0) {
const response = await fetch('/search-index.json')
searchData = await response.json()
}
return searchData
}
async function getIndex(): Promise<any> {
if (!sectionIndex) {
const data = await loadSearchData()
sectionIndex = new FlexSearch.Document({
tokenize: 'full',
document: {

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC