forceCalendar
API Reference

SearchWorkerManager

API reference for the SearchWorkerManager and InvertedIndex classes.

import { SearchWorkerManager, InvertedIndex } from '@forcecalendar/core';

SearchWorkerManager

Constructor

new SearchWorkerManager(eventStore: EventStore)

Methods

MethodSignatureReturns
search(query: string, options?: SearchOptions) => Promise<SearchResult[]>Search results
indexEvents() => Promise<void>
clear() => void
destroy() => void

Falls back to InvertedIndex when Web Workers are unavailable.

InvertedIndex

Constructor

new InvertedIndex()

Methods

MethodSignatureReturns
buildIndex(events: Event[]) => void
tokenize(text: string) => string[]Tokens
search(query: string, options?: object) => SearchResult[]Results
clear() => void

Field Boost Weights

FieldBoost
title2.0
location1.5
category1.5
description1.0