quran-search-engine

Search Configuration

The main search function accepts two optional configuration layers allowing fine-tuned control over behavior and pagination limits.

SearchOptions

Toggles linguistic matching logic. Enabling Lemma & Root requires you to pass valid morphologyMap and wordMap payloads.

export type AdvancedSearchOptions = {
  // Required mapping variables
  lemma: boolean;
  root: boolean;

  // Optional matching variables
  fuzzy?: boolean; // Default: true
  isRegex?: boolean;
  semantic?: boolean;

  // Optional geographic filtering parameters
  suraId?: number;
  juzId?: number;
  suraName?: string;
  sura_name_en?: string;
  sura_name_romanization?: string;
};

export type SearchOptions = AdvancedSearchOptions;

PaginationOptions

Control bounds limit constraints natively. Omitting these defaults to logical page limits (typically page 1, limit 50).

export type PaginationOptions = {
  page?: number; // Starting return page.
  limit?: number; // Count return offset per page limit.
};